#Predicate is a new Macro available since Swift 5.9 and Xcode 15, allowing you to filter or search a data collection. It can be seen as a replacement for the old-fashioned NSPredicate we’re used to from the Objective-C days. The new Predicate is available as a Macro. If you’re new to Macros, I encourage you …
SwiftSyntax: Parse and Generate Swift source code
SwiftSyntax is a collection of Swift libraries that allow you to parse, inspect, generate, and adjust Swift source code. It was initially developed by Apple and is currently maintained as an open-source library with many contributors. You can find documentation on swiftpackageindex.com and many articles in the GitHub readme. The SwiftSyntax library is the foundation upon …
Build performance analysis for speeding up Xcode builds
Build performance can be analyzed in Xcode to speed up your builds. This can quickly speed up your workflow and save a lot of time during the day for all developers working on the project. Slow builds often distract us as they enable us to focus on distractions like social media and Slack. By investigating …
Xcode Debug Console Tour: Exploring All Options
The Xcode Debug Console allows you, as a developer, to explore logs and debug issues with your apps. All your logs will be printed out, and you can interact with the LLDB debugger as soon as your app pauses manually or due to a breakpoint. Xcode 15 introduced a new version of the debug console …
Localization testing in Xcode
Localization testing becomes vital if your apps are localized in multiple languages. You want to ensure your UI looks good in each language, making you repeatedly run your app in each locale. Some words are different in length depending on the language, making it crucial to verify your interfaces. Xcode provides several options for testing …
OSLog and Unified logging as recommended by Apple
OSLog is a replacement for print, and NSLog and Apple’s recommended way of logging. It has different logging levels, like debugging, warning, and error logs. Altogether, it allows you to create an enriched logging experience fitting nicely in Xcode 15’s new logging console. OSLog has a low-performance overhead and is archived on the device for …
@backDeployed to extend function availability to older OS releases
The @backDeployed attribute in Swift allows you to extend function availability back to older OS versions. It’s beneficial for framework developers to make new declarations available to apps with a lower minimum deployment target compared to the framework. SE 376 Function Back Deployment introduced the attribute as a proposal, after which it got first implemented …
App Intents Spotlight integration using Shortcuts
App Intents have been new since iOS 16 and offer a programmatic way to service your app’s content and functionality to Siri and the Shortcuts app. New in iOS 17 is the option to surface App Shortcuts integrated into Spotlight, making your app’s functionality even more discoverable. App Intents are the engine behind many features …
#Preview SwiftUI Views using Macros
Starting with Xcode 15 and Swift 5.9, you can create previews for your SwiftUI view using the new #preview Macro. The macro replaces the PreviewProvider protocol that required us to define previews within a static computed property. Swift 5.9 also introduced Macros, the concept behind this new hashtag attribute. I encourage you to read Swift …
Xcode Bookmarks: Save code landmarks & organize tasks
Xcode Bookmarks were introduced during WWDC 2023 as part of the significant Xcode 15 release. They are a new feature that allows you to save quick links to code you want to revisit. Doing so allows you to save code landmarks and organize tasks you have to fulfill. You can add new bookmarks from several …