Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

Sendable and @Sendable closures explained with code examples

Sendable and @Sendable are part of the concurrency changes that arrived in Swift 5.5 and address a challenging problem of type-checking values passed between structured concurrency constructs and actor messages. Before diving into the topic of sendables, I encourage you to read up on my articles around async/await, actors, and actor isolation. These articles cover … 

 

UIViewRepresentable explained to host UIView instances in SwiftUI

Adopting the UIViewRepresentable protocol allows you to host UIView instances in SwiftUI. Your SwiftUI code is converted to UIKit views behind the scenes. SwiftUI requires you to declare the view representation, but the underlying SwiftUI implementation will optimize how final views are drawn on the screen. You can use a similar technique to make SwiftUI … 

 

URLSessionConfiguration: Exploring opt-in configurations

URLSessionConfiguration can be used to initialize URLSession instances in Swift. While in most cases, you’ll likely use the default configuration, you’ll also have the opportunity to create a custom configuration with non-default settings. The default URLSessionConfiguration uses standard configurations that work best for most apps. However, no configuration fits all, and you can likely optimize … 

 

App Store Connect API SDK in Swift: Creating Developer Tools

The new App Store Connect API was announced during WWDC 2018 and made it possible to write applications for App Store Connect. You can use the API to fetch metadata for apps, TestFlight builds, download sales reports, and much more. Apple added new endpoints over the years, with most recently the release of their 2.0 … 

 

Generics in Swift explained with code examples

Generics in Swift allows you to write generic and reusable code, avoiding duplication. A generic type or function creates constraints for the current scope, requiring input values to conform to these requirements. You’ve probably been using generic implementations already since they’re all over the place in the Swift standard library. Though, using them in your … 

 

Existential any in Swift explained with code examples

Existential any allows you to define existential types in Swift by prefixing a type with the any keyword. In short, an existential means “any type, but conforming to protocol X.” Any and AnyView have different purposes, which I explain in my article AnyObject, Any, and any: When to use which?. In this article, I’ll explain … 

 

Some keyword in Swift: Opaque types explained with code examples

The some keyword in Swift declares opaque types, and Swift 5.1 introduced it with support for opaque result types. Many engineers experience working with opaque types for the first time when writing a body of a SwiftUI view. Though, it’s often unclear what some keyword does and when to use them in other places. With … 

 

Using NavigationLink programmatically based on binding in SwiftUI

NavigationLink in SwiftUI allows pushing a new destination view on a navigation controller. You can use NavigationLink in a list or decide to push a view programmatically. The latter enables you to trigger a new screen from a different location in your view. Allowing to push a new screen onto a navigation stack is as … 

 

App Icon Generator is no longer needed with Xcode 14

An App Icon Generator generates all required app icon sizes based on a single-size icon input file. Creating and dragging all those app icons into Xcode is often tiresome since we’ve all asked ourselves: “Why can’t Xcode just generate the sizes for us based on a single file?” Well, there’s good news! During WWDC 2022, … 

 

Increase App Ratings by using SKStoreReviewController

SKStoreReviewController allows asking your users for App Store ratings from within the app. Positive ratings can help your app stand out in the App Store and attract more users. Conversions can increase when you ask the user for a rating at the right time. While implementing rating requests is easy, it can become more complex …