Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

Closures in Swift explained with Code Examples

Closures in Swift can be challenging to understand with types like trailing closures, capturing lists, and shorthand syntaxes. They’re used throughout the standard library and are part of the basics you need to know when writing Swift code. Xcode will help us most of the time with the right syntax using autocompletion but it’s good … 

 

What is a Computed Property in Swift?

Computed properties are part of a family of property types in Swift. Stored properties are the most common which save and return a stored value whereas computed ones are a bit different. A computed property, it’s all in the name, computes its property upon request. It can be a valuable addition to any of your … 

 

SwiftLee 2020 In Review: Most read blog posts

Every year I’m looking back at what I achieved with SwiftLee as well as what I want to achieve in the upcoming year. I did this in 2018, 2019, and I’m doing the same in this blog post for 2020. 2020 is definitely not comparable to the years before due to COVID and all its … 

 

Getting started with associated types in Swift Protocols

Associated types in Swift work closely together with protocols. You can literally see them as an associated type of a protocol: they are family from the moment you put them together. Obviously, it’s a bit more complicated to explain how associated types work but once you get the hang of it, you’ll be using them … 

 

Result in Swift: Getting started with Code Examples

The Result enum is available since Swift 5 and allows us to define a success and failure case. The type is useful for defining the result of a failable operation in which we want to define both the value and error output type. The standard Swift library adds more functionality to the result type which … 

 

Xcode Mark Line to improve readability using // Mark: comments

Xcode Mark Lines allows us to create a better overview of sections within our classes or structs. A so-called mark comment adds both a chapter title and linebreak in the Xcode method navigator. This chapter split makes it easier to quickly navigate through a relative big object. Even-though this technique is great and allows us … 

 

App Launch Time: 7 tips to increase performance

App Launch Time is the time it takes before your app becomes responsive after startup. As the first experience of your user it’s important that it’s smooth and as fast as possible. A slow startup time could mean losing a lot of users which can result in less usage in your app. Even-though today’s devices … 

 

Data validation on insertion, update, and deletion in Core Data

Data validation in apps is important to make sure we save data conforming to the business rules. A name should be of a certain length and can’t contain invalid characters. It’s tempting to write all this logic in a new “Validator” class while we do a lot of this directly in our Core Data model … 

 

Derived Attributes to improve Core Data Fetch Performance

Derived attributes are available since iOS 13 and aim to improve fetch performance in many different scenarios. Although we have great performance with the latest devices it’s good to be prepared for scaling up to fetching a large number of items from your database. Your memory footprint might look good now but once you start … 

 

Constraints in Core Data Entities explained

Constraints in Core Data are part of an entity configuration. Settings like the entity name and Spotlight display name might be easy to understand while constraints are a bit less known. However, they can be super useful to maintain a unique set of data. Constraints can take away the need to filter out for existing …