Win a ticket for the Do iOS Conference in Amsterdam Join here.
Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

Thread dispatching and Actors: understanding execution

Actors ensure your code is executed on a specific thread, like the main or a background thread. They help you synchronize access to mutable states and prevent data races. However, developers commonly misunderstand how actors dispatch to threads in non-async contexts. It's an essential understanding to avoid unexpected crashes. Before ...
ConcurrencySwift

Value and Type parameter packs in Swift explained with examples

Type parameter packs and value parameter packs allow you to write a generic function that accepts an arbitrary number of arguments with distinct types. As a result of SE-393, SE-398, and SE-399, you can use this new feature from Swift 5.9. One of the most noticeable places of impact is ...
Swift

App Intent driven development in Swift and SwiftUI

App Intent driven development can help you architect your code for reusability. An app intent allows you to define an action or provide content as a result. Using intents, you can extend custom functionality and data to support system-level services like Shortcuts, Siri, Spotlight, and the Action button. You might ...
Swift

If and switch expressions in Swift

Swift 5.9 introduced if and switch expressions that allow you to write shorter code by omitting the return keyword. The feature resembles Swift 5.1's ability to omit the return keyword in single expressions inside closures. While shorter code doesn't necessarily always lead to more readable code, omitting return keywords inside ...
Swift

Predicate Macro in Swift for filtering and searching

#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 ...
Swift

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 ...
Swift

@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 ...
Swift

Swift Macros: Extend Swift with New Kinds of Expressions

Swift Macros got introduced in the WWDC 2023 release of Swift 5.9. They are a new way for you to extend Swift with new kinds of expressions, allow creating of expressive libraries, and eliminate extraneous boilerplate. As part of the vision of Macros, Swift Macros introduce a new way to ...
Swift

Share Swift Code between Swift On Server Vapor and Client App

Sharing Swift code between a backend and client app is one of the benefits you'll get when working with Swift on a Server. You can create dedicated Swift Packages containing sharable logic for both client and backend. While many developers mention sharing Swift code as one of the benefits of ...
Swift

Ranges in Swift explained with code examples

Ranges in Swift allow us to select parts of Strings, collections, and other types. They're the Swift variant of NSRange which we know from Objective-C, although they're different in usage, as I'll explain in this blog post. Ranges allow us to write elegant Swift code by using the range operator ...
Swift

MainActor usage in Swift explained to dispatch to the main thread

MainActor is a new attribute introduced in Swift 5.5 as a global actor providing an executor which performs its tasks on the main thread. When building apps, it's essential to perform UI updating tasks on the main thread, which can sometimes be challenging when using several background threads. Using the ...
ConcurrencySwift

Optimizing your app for Network Reachability

Network Reachability is a vital aspect of apps that use some networking capabilities. Your users won't always have a good internet connection, so optimizing your app for bad networking conditions is essential. We can leverage several techniques to optimize our app accordingly, but it's essential to be aware of common ...
Swift