Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

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

The operation couldn’t be completed: solving errors in Swift

"The operation couldn't be completed" is a common error to receive from Apple's standard SDKs or 3rd party libraries. The errors often come with an error code that doesn't have a description, leaving you behind with unclear directions on solving the issue. I've been running into these errors quite often, ...
Swift

Equatable conformance in Swift explained with code examples

Equatable conformance allows you to compare one object with another. Based on whether the objects match, you can perform a specific operation. You can rely on default comparison implementations or custom logic to compare two objects. Many standard types are already comparable, but you must implement protocol conformance for your ...
Swift