Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

Win a Let's visionOS 2024 conference ticket. Join for free

Optionals in Swift explained: 5 things you should know

Optionals are in the core of Swift and have existed since the first version of Swift. An optional value allows us to write clean code while at the same time taking care of possible nil values. If you're new to Swift, you should get used to the syntax of adding ...
Swift

Extensions in Swift: How and when to use them

Extensions in Swift allow you to extend an existing class, struct, enumeration, or protocol with new functionality. Whether it's a custom type defined by you or a current type inside of a framework, extensions can create custom accessors and enhance the types you work with. So-called retroactive modeling allows you ...
Swift

Swift Evolution: Reading and learning from proposals

The Swift Programming Language constantly evolves, and most of its changes result from public proposals inside the Swift Evolution repository. The proposals can tell you what changes are coming up next, which is excellent if you want to stay updated with the latest developments. Swift Evolution Proposals can also help ...
Swift

User Defaults reading and writing in Swift

User Defaults are the go-to solution for Swift applications to store preferences that persist across launches of your app. It's a key-value store backed by a property list (plist) file. Due to this type of backing store, you need to be aware of the supported storage types. There are a ...
Swift

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