Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

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 … 

 

NSManagedObject events: handling state in Core Data

An NSManagedObject lifecycle goes from insertion and updates until deletion in the end. All those events come with their own common related modifications and can be used in many different ways. Managing state in Core Data from within the NSManagedObject class itself is a great way to keep logic centralized. Updating a creation date, modified … 

 

Try Catch Throw: Error Handling in Swift with Code Examples

Try catch in Swift combined with throwing errors make it possible to nicely handle any failures in your code. A method can be defined as throwing which basically means that if anything goes wrong, it can throw an error. To catch this error, we need to implement a so-called do-catch statement. It’s not always required …