Getting Started with App Intents and Siri Shortcuts
Expose your app's features to Siri, Shortcuts, and Spotlight with App Intents, the Swift-native replacement for SiriKit in iOS 16 and later.
// 42 articles available
Expose your app's features to Siri, Shortcuts, and Spotlight with App Intents, the Swift-native replacement for SiriKit in iOS 16 and later.
A practical guide to App Tracking Transparency in iOS, covering the Info.plist usage description, the ATTrackingManager API, authorization statuses, and when to actually prompt the user from SwiftUI.
Continuations bridge completion-handler APIs into async/await. The checked variant catches the two ways you can get it wrong, and the unsafe one trusts you completely.
SE-0491 introduces the :: operator to disambiguate names that come from different modules. Here is when you actually need it and the gotchas worth knowing.
Swift 6's data-race safety is real, but it has blind spots. Here are the places the compiler can't see, and how to stop treating a clean build as proof your code is thread safe.
OSAllocatedUnfairLock wraps os_unfair_lock with a closure-based API that makes it impossible to forget to unlock and keeps the lock's storage alive for as long as you need it.
URLProtocol is one of the oldest interception points in Foundation's networking stack. It lets you mock, log, or transform any URLSession request without touching the code that makes the request.
SE-0493 finally lets you write defer { await cleanup() } in async functions, without spawning a detached task or threading cleanup logic through every return path.
print is fine for scratch work, but production apps need categories, levels, and privacy redaction. Here is how the Logger API from the os module gives you all of that without much ceremony.
Swift 6.4's withTaskCancellationShield lets cleanup code run to completion even after a task has been cancelled, without spawning extra unstructured tasks.
Swift 6.2 changes how async functions pick a thread by default. The new @concurrent attribute lets you explicitly opt into background execution when you actually need it.
Build a @DefaultEmpty property wrapper that automatically defaults missing or null array fields to an empty array when decoding JSON in Swift.
Swift Testing replaces XCTest with a cleaner macro-based API. Learn how to write tests with @Test, #expect, parameterized inputs, and traits in Xcode 16+.
Swift macros generate code at compile time, reducing boilerplate and catching errors early. Learn how to use built-in macros and understand how custom macros work.
A practical guide to Swift error handling covering throw/try/catch fundamentals, custom error types, Result, async error patterns, and typed throws introduced in Swift 6.
Understand the key difference between a UIView's frame and bounds properties, and when to use each in your iOS apps.
Master Swift's TaskGroup for parallel async work with proper cancellation, error handling, and result collection. Learn common patterns for batch operations and concurrent pipelines.
Swift 6 introduces typed throws, letting you declare exactly which error types a function can throw. Learn how this improves API contracts and enables exhaustive error handling.
Learn how to use Swift's RegexBuilder DSL to create readable, type-safe regular expressions with compile-time checking and strongly-typed captures.
A practical guide to implementing in-app purchases and subscriptions with StoreKit 2, covering products, transactions, subscription status, and SwiftUI integration.
Apple released Swift System Metrics 1.0, a package that collects process-level metrics like CPU time, memory usage, and file descriptors with a unified API across Linux and macOS.
Compare @AppStorage, UserDefaults, and SwiftData for persisting data in Swift apps. Learn when each approach makes sense and how to use them effectively.
Learn what the "some" keyword means in Swift, how opaque return types work, and why SwiftUI uses "some View" everywhere.
Swift offers actors, GCD, and locks for thread safety. Each solves the same problem differently. Here's how to choose.
Actors provide compile-time safety for shared mutable state in Swift. Here's when to use them and how they compare to older approaches.
Grand Central Dispatch remains a practical choice for thread safety in Swift, especially when you need synchronous access or are working with legacy code.
Locks offer the lowest overhead for thread synchronization in Swift. Here's when that matters and how to use them safely.
A practical introduction to async/await in Swift, covering the fundamentals you need to write concurrent code that's both safe and readable.
Both async/await and Grand Central Dispatch solve concurrency problems, but they approach them differently. Here's how to choose between them.
A refactoring mishap with arithmetic expressions led me down the rabbit hole of operator precedence differences between Swift and Objective-C. Here's what to watch for.
Learn how to use AlarmKit to schedule alarms and countdown timers that appear on the Lock Screen and Dynamic Island on iOS 26.
Learn how to use AppStore.ageRatingCode to read your app's current age rating and react to rating changes for parental consent compliance.
Failable initializers offer a cleaner alternative to if-let statements when your SwiftUI views depend on optional data.
How to traverse the view controller hierarchy to find the currently visible view controller.
How to generate random emoji characters in Swift using Unicode scalar ranges.
How to check available and total disk space on iOS devices using URL resource values.
Learn how to access and configure environment variables in Swift applications for configuration management, API keys, and feature toggles.
Learn how to use kCFStringTransformToUnicodeName to get the system name for any emoji.
Learn how to prevent typing with your physical keyboard from dismissing the software keyboard when running your Swift app in the iOS simulator.
A practical guide to the different methods for adding single elements, multiple elements, and inserting at specific positions in Swift arrays.
Learn how to access your app's App Delegate from anywhere in your Swift code, including from SwiftUI views.
Learn multiple approaches to replace characters and substrings in Swift strings, from simple replacements to pattern-based transformations.