Structured Logging in Swift with Logger and os_log
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.
// 182 articles available
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.
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.
How to set up custom URL schemes and Universal Links in iOS, handle incoming URLs in SwiftUI, and route users to the right screen.
A practical guide to scheduling and handling local notifications in iOS using UNUserNotificationCenter, from permission requests to actionable notification categories.
Build a @DefaultEmpty property wrapper that automatically defaults missing or null array fields to an empty array when decoding JSON in Swift.
React Native build failing on Xcode 26.4 with a fmt consteval error? Build only the fmt pod as C++17 with this short Podfile fix.
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.
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.
Swift 6.4's withTaskCancellationShield lets cleanup code run to completion even after a task has been cancelled, without spawning extra unstructured tasks.
Learn how to use Swift's RegexBuilder DSL to create readable, type-safe regular expressions with compile-time checking and strongly-typed captures.
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.
Set up Claude Code to automatically keep your Mac awake during long tasks and let it sleep again when finished, using hooks and the caffeinate command.
Understand the key difference between a UIView's frame and bounds properties, and when to use each in your iOS apps.
A practical guide to SwiftUI animations covering implicit and explicit animations, spring physics, PhaseAnimator for multi-step sequences, and KeyframeAnimator for timeline-based control.
ViewThatFits picks the first child view that fits the available space. See how to build adaptive SwiftUI layouts with it, with examples and gotchas.
iOS 18 introduced public APIs for building custom container views that can decompose content into individual subviews. Learn how to use ForEach(subviews:), Group(subviews:), and ContainerValues.
Xcode eats storage through DerivedData, old simulators, device support files, and archives. Here's what each folder is and what is safe to delete.
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.
Create interactive buttons for the Control Center using ControlWidgetButton and App Intents in iOS 18.
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.
Add haptic feedback to your SwiftUI views using the sensoryFeedback modifier, with built-in support for success, error, impact, and selection feedback.
The Xcode MCP server connection prompt interrupts your flow every time you restart Claude Code or clear your session. Here's how to automate it away using hooks.
Learn how to test push notifications on iOS simulators without needing a device or server setup using xcrun simctl push.
Learn how to use Swift's @Observable macro introduced in iOS 17, understand its advantages over ObservableObject, and migrate your existing code to the modern observation system.
Use @AppStorage for small SwiftUI settings, UserDefaults outside views, and SwiftData for real models. Here is when each one fits, with code.
Learn how to create beautiful, interactive charts in SwiftUI using Apple's Swift Charts framework, from simple line charts to customized bar graphs.