// Shorts
One concept at a time
Modern mobile APIs explained in about two minutes each — what problem it solves, working code, and the trap you'll hit the first time you use it.
74 shorts
SwiftUI
20@Observable: State Without the Boilerplate
The @Observable macro replaces @Published and ObservableObject with less code and smarter view invalidation.
@Bindable: Two-Way Bindings Into @Observable
@Bindable unlocks two-way SwiftUI bindings into an @Observable class without giving up single ownership.
@Entry: Custom Environment Values in One Line
The @Entry macro turns a multi-step EnvironmentKey into one line for custom environment and focus values.
ContentUnavailableView: The Empty State You Don't Have to Build
ContentUnavailableView gives every app the same polished empty state and no-search-results screen for free.
.inspector: One Modifier, Every Platform's Detail Pane
The .inspector modifier adds a trailing detail pane that adapts automatically across iPhone, iPad, and Mac.
scrollTargetBehavior: Snapping Carousels, No UIKit
Build a paging, view-aligned carousel with plain SwiftUI — no UICollectionView, no compositional layout.
scrollPosition(id:): Reading and Driving Scroll Position
A two-way binding to the currently scrolled item — jump to content and observe scroll position with one API.
containerRelativeFrame: Sizing Children as a Fraction of Their Container
Size a view as a percentage of its scroll view or container without a GeometryReader in sight.
scrollTransition: Per-Item Effects Driven by Scroll Phase
Scale and fade carousel items as they enter and leave the viewport, without measuring frames yourself.
onScrollGeometryChange: Scroll Offset Without GeometryReader Hacks
Observe raw scroll offset directly on the ScrollView, no PreferenceKey plumbing required.
phaseAnimator: Multi-Step Animation in One Modifier
Sequence a bump, settle, and rest animation without chaining withAnimation calls or DispatchQueue delays.
KeyframeAnimator: Independent Timelines Per Property
Animate scale, offset, and rotation on their own timelines with keyframeAnimator, instead of one shared curve.
symbolEffect: Native Animation for SF Symbols
Bounce, pulse, and morph SF Symbols with built-in effects instead of hand-rolled scale and crossfade tricks.
contentTransition(.numericText()): Odometer-Style Numbers
Roll digits up or down like an odometer when a number changes, with one modifier and no custom digit views.
visualEffect: Geometry-Driven Effects, No GeometryReader
Scale scroll-carousel cards by their position using visualEffect, without wrapping each card in a GeometryReader.
MeshGradient: Real Gradient Meshes in SwiftUI
SwiftUI's MeshGradient renders true multi-point gradient meshes natively, replacing hacky stacks of blurred RadialGradients.
Tab and .sidebarAdaptable: One Tab Bar for iPhone and iPad
The new Tab builder plus .tabViewStyle(.sidebarAdaptable) turns one TabView into an iPad sidebar and an iPhone tab bar automatically.
Hero Zoom Push Transitions with navigationTransition(.zoom)
.navigationTransition(.zoom) turns a NavigationStack push into a hero zoom transition with no custom animation code.
glassEffect(): Liquid Glass on Custom Views
.glassEffect() applies Apple's iOS 26 Liquid Glass material to any custom view with a single modifier.
GlassEffectContainer: Morphing Glass Elements
GlassEffectContainer groups glass views so they sample light together, and glassEffectID morphs one glass shape into another.
Swift
11async/await: Replacing Completion Handlers
async/await turns nested completion handler pyramids into linear, readable code the compiler can check.
Structured Concurrency: async let and TaskGroup
async let and TaskGroup run child tasks in parallel while guaranteeing they finish before the enclosing scope exits.
Actors: Data Race Protection by Construction
Actors serialize access to their mutable state so the compiler, not a lock or a queue, prevents data races.
Sendable and Why the Compiler Shouts at You
Sendable marks types that are safe to pass across concurrency domains, and the compiler enforces it at every boundary.
@MainActor: What It Actually Guarantees
@MainActor guarantees isolation to the main actor's serial executor, which in practice means the main thread, not synchronous execution.
withCheckedThrowingContinuation: Bridging Callback APIs
Continuations wrap a callback-based API in a single async call, as long as the callback is invoked exactly once.
AsyncSequence and AsyncStream
AsyncSequence turns a stream of future values into something you can loop over with for-await, and AsyncStream builds one from callbacks.
Task Cancellation Is Cooperative
Cancelling a Task only flips a flag — the running code has to check it and stop itself, or it keeps running to completion.
Writing an Attached Macro
Attached macros generate code from a declaration you annotate, expanded at compile time and checked by the type checker.
Result Builders: How @ViewBuilder Actually Works
@resultBuilder turns a sequence of statements into a single composed value, which is the mechanism SwiftUI's @ViewBuilder is built on.
Typed Throws and Richer Error Signatures
Typed throws let a function declare exactly which error type it throws, so callers can catch it exhaustively without casting.
Apple Frameworks
11SwiftData: @Model and the Modern Persistence Stack
SwiftData replaces Core Data's NSManagedObject ceremony with a plain Swift @Model macro and a Swift-native container.
@Query, Predicates, and Sorting in SwiftData
@Query keeps SwiftUI views in sync with SwiftData automatically, driven by #Predicate and SortDescriptor.
WidgetKit: Timelines and Reload Policies
WidgetKit renders a widget from a pre-built schedule of entries, not a continuously running process.
App Intents: Making Your App Scriptable and Siri-Visible
App Intents replaces SiriKit's fixed intent domains with a Swift protocol any app action can conform to.
Live Activities and the Dynamic Island
ActivityKit keeps a live-updating view on the Lock Screen and Dynamic Island in sync, locally or via push.
Swift Testing: @Test, #expect, and Parameterised Tests
Swift Testing replaces XCTest's class-and-assertion ceremony with free functions, macros, and native parameterisation.
StoreKit 2: Purchases Without the Ceremony
StoreKit 2 replaces payment queue observers and receipt parsing with async/await and signed transaction values.
Swift Charts: Declarative Data Visualisation
Swift Charts builds charts out of SwiftUI-style marks instead of hand-rolled Core Graphics drawing code.
On-Device Inference with Core ML and Vision
Core ML and Vision run trained models and image analysis directly on-device, no network round trip required.
BGTaskScheduler: Work That Survives Backgrounding
BGTaskScheduler lets iOS decide when to wake your app for maintenance work instead of you fighting for background time.
os_signpost and Instruments for Real Performance Data
os_signpost emits custom timeline events Instruments can visualise, turning guesswork about slow code into real data.
Jetpack Compose
12derivedStateOf: Stop Recomposing on Every Scroll Pixel
Derive booleans from fast-changing state so composables only recompose when the derived value actually changes.
Stable Keys in LazyColumn: Why Item Identity Matters
Give LazyColumn items a stable key or Compose loses item state and over-recomposes on every list mutation.
LaunchedEffect vs DisposableEffect vs SideEffect
Three effect APIs for three jobs: coroutine work, cleanup-requiring subscriptions, and publishing state out of Compose.
Stability, @Immutable/@Stable, and Skippable Composables
The Compose compiler only skips recomposition when it can prove a composable's parameters are stable.
Modifier Order Changes the Result: padding vs size vs background
Modifier chains apply outside-in in the order written — swap padding and background and you get a different layout.
State Hoisting: Stateless Composables You Can Actually Reuse
Move mutable state out of a composable and up to its caller so the composable becomes reusable and testable.
snapshotFlow: Bridging Compose State to Flow
Turn any Compose State read into a cold Flow that emits on distinct changes, with the full set of Flow operators.
Shared Element Transitions in Compose
Animate a thumbnail morphing into its detail view with SharedTransitionLayout instead of a hard navigation cut.
Predictive Back Gestures in Compose
Animate the UI as the user drags the back gesture instead of jump-cutting away once it completes.
WindowSizeClass for Adaptive Layouts
Branch layout structure on coarse width/height buckets instead of hardcoding phone-only dimensions.
Compose Multiplatform Resources: One Res Object, Every Target
Share drawables and strings across Android, iOS, and desktop from a single composeResources source set.
Finding Needless Recomposition with the Layout Inspector
Turn on recomposition counts in Android Studio to see exactly which composables are re-running, and why.
React Native
10Fabric: The New Architecture Renderer in Plain Terms
Fabric replaces the old UIManager bridge with a synchronous, thread-safe renderer built on JSI.
TurboModules: Lazy Native Modules and Codegen
TurboModules load native modules lazily and type-check them via codegen instead of the untyped NativeModules bridge.
JSI and Bridgeless Mode: What Actually Changed
JSI replaces the async JSON bridge with direct C++ host object bindings, and bridgeless mode removes the bridge entirely.
Reanimated Worklets: Animation Off the JS Thread
Worklets run small JS functions on the UI thread so gesture-driven animations don't stutter when the JS thread is busy.
FlashList: Fixing FlatList Performance
FlashList recycles views instead of remounting them, fixing FlatList's blank-cell flicker and memory growth on long lists.
Expo Router: File-Based Navigation
Expo Router turns your file tree into your navigation graph, replacing manually wired React Navigation stacks.
Hermes: Bytecode, Startup Time, and When It Helps
Hermes precompiles JS to bytecode at build time, trading a slower build for faster app startup and lower memory use.
Migrating an App to the New Architecture
Turning on Fabric and TurboModules is one flag, but every native dependency in your tree has to support it first.
Writing a Native Module in Swift and Kotlin
A TurboModule needs a typed JS spec plus matching Swift and Kotlin implementations generated from the same codegen contract.
Profiling Render Performance and Dropped Frames
Finding a jank source means correlating a dropped-frame timeline with which JS render or native operation was running then.
Kotlin Multiplatform
10expect/actual: The Core of Shared Kotlin Code
expect/actual lets shared Kotlin code declare an API once and have each platform supply its own implementation.
Source Sets and the Hierarchy Template
Kotlin Multiplatform's default hierarchy template auto-creates intermediate source sets so iOS targets share code without manual wiring.
Sharing Coroutines and Flow Across Platforms
Kotlin/Native's coroutine runtime lets commonMain code use suspend functions and Flow exactly like JVM code.
Ktor Client as the Shared Networking Layer
Ktor's multiplatform HTTP client puts request building, serialization, and error handling in one shared networking layer.
SQLDelight: Typed SQL Shared Across Platforms
SQLDelight generates typed Kotlin query APIs from real SQL, shared across Android and iOS with per-platform drivers.
Consuming a KMP Module from Swift
Kotlin/Native compiles shared code to a framework Swift calls directly, with suspend functions arriving as completion handlers.
Compose Multiplatform: Sharing UI, and When Not To
Compose Multiplatform shares full screens across Android and iOS via Skia, but native idioms are still sometimes the better call.
Dependency Injection in Shared Code with Koin
Koin builds one dependency graph in commonMain, started from each platform's entry point without reflection.
Testing Shared KMP Code Across Targets
kotlin.test gives commonTest one assertion API that runs as JUnit on Android and as a native binary on iOS.
cinterop: Calling Platform C/Objective-C APIs
cinterop generates Kotlin bindings for C and Objective-C libraries, letting shared iOS code call system frameworks directly.