Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

SwiftLee 2022: A Year in Review

Another year passed by, and we’re close to getting into 2023. It’s been a year with a single Swift 5.7 release, Xcode 14, new SwiftLee products, and many articles. I always enjoy looking back on the year and realizing what I’ve achieved, hopefully inspiring others for the year to come. More than ever, I’ve been … 

 

OptionSet in Swift explained with code examples

OptionSet in Swift allows you to define a set of options for configurations. It’s the Swift variant of the well-known NS_OPTIONS in Objective-C and it’s used throughout the standard libraries. A set of options is often confused by a set of enum cases, but they’re not the same. While you could create a similar solution … 

 

How to use FormatStyle to restrict TextField input in SwiftUI

A custom FormatStyle can help you control the allowed characters of a SwiftUI TextField. You might want to allow numbers only or a specific set of characters. While you could use a formatter in many cases, it’s good to know there’s a flexible solution using a custom FormatStyle implementation. In my case, I was looking … 

 

Sheets in SwiftUI explained with code examples

Sheets in SwiftUI allow you to present views that partly cover the underlying screen. You can present them using view modifiers that respond to a particular state change, like a boolean or an object. Views that partly cover the underlying screen can be a great way to stay in the context while presenting a new … 

 

@dynamicCallable in Swift explained with code examples

It’s all in the name: @dynamicCallable in Swift allows you to dynamically call methods using an alternative syntax. While it’s primarily syntactic sugar, it can be good to know why it exists and how it can be used. We covered @dynamicMemberLookup earlier, allowing us to express member lookup rules in dynamic languages naturally. @dynamicCallable is … 

 

Binary Targets in Swift Package Manager

Binary Targets in Swift Package Manager (SPM) allow packages to declare xcframework bundles as available targets. The technique is often used to provide access to closed-source libraries and can improve CI performance by reducing time spent on fetching SPM repositories. Both downs and upsides are essential to consider when adding binary targets to your project. … 

 

Result builders in Swift explained with code examples

Result builders in Swift allow you to build up a result using ‘build blocks’ lined up after each other. They were introduced in Swift 5.4 and are available in Xcode 12.5 and up. Formerly known as function builders, you’ve probably already used them quite a bit by building a stack of views in SwiftUI. I … 

 

Getting started with Unit Tests in Swift

Unit tests in programming languages ensure that written code works as expected. Given a particular input, you expect the code to come with a specific output. By testing your code, you’re creating confidence for refactors and releases, as you’ll ensure the code works as expected after running your suite of tests successfully. Many developers do … 

 

Refactoring Swift: Best Practices to succeed

Refactoring code is part of the journey toward building sustainable apps. Whether you’re experienced or not: every developer refactors their code to improve its quality or readability. A refactor can be small enough to make you do it unconsciously, while bigger ones can become intimidating. I’ve been developing apps for over 10+ years in which … 

 

Announcing the SwiftLee Talent Collective

Today I’m excited to introduce you to the SwiftLee Talent Collective — an initiative to connect engineers with exciting companies. One of the most frequently asked questions I get relates to how to find a new job or how to make the next career step. I wrote about Swift Jobs: How to make the right …