Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

Using Custom debug descriptions to improve debugging

Custom debug descriptions can help you debug your own custom objects, structs, errors, and other types. Whenever you print out an object you might end up with basic information that doesn't really help you solve your issue. Printing out a struct shows you all the values while you might only ...
DebuggingSwift

URLs in Swift: Common scenarios explained in-depth

URLs are everywhere in an app we built. We reference local files using bundle paths, we fetch data from a path pointing to our API, and we fetch images to display visuals. While working with URLs we often need to verify things like making sure that it's pointing to a ...
Swift

Custom Operators in Swift with practical code examples

Custom operators in Swift can make your code easier to read and simpler to maintain. Code can be written less lines of code while keeping it clear what is happening. Custom operators are also known as advanced operators and allow you to combine two instances with a self-chosen infix, prefix, ...
Swift

Custom subscripts in Swift explained with code examples

Custom subscripts in Swift allow you to write shortcuts to elements from collections or sequences and can be defined within classes, structures, and enumerations. You can use subscripts to set and retrieve values without exposing the inner details of a certain instance. An instance can define multiple subscripts and a ...
Swift

NSFetchedResultsController extension to observe relationship changes

Apple provides us with great classes like the NSFetchedResultsController to interact with Core Data databases in our apps. The API evolved over the years with additions like support for the new NSDiffableDataSource. However, there are still scenarios where the default API is not helping enough. At WeTransfer, we heavily make ...
Core DataSwift

Testing private methods and variables in Swift

Testing private methods and variables is often something we run into when writing tests for our applications. You could think that it's needed to fully verify that your code is working as expected and it helps you to get to that 100% code coverage. If you're new to unit testing ...
Swift

How to mock Alamofire and URLSession requests in Swift

Mocking data requests that are triggered by either Alamofire or URLSession is something we all run into when we start writing tests for our networking layer. When writing tests, it's important that we don't actually run the requests so we don't mess up our backend database with dummy data. Also, ...
Swift

Creating a command line tool using the Swift Package Manager

A command-line tool can be very useful for automating common tasks to boost developer productivity. While developing iOS applications we often make use of command-line tools like Fastlane and CocoaPods but it's less common to write your own command-line tools for daily use. The Swift Package Manager makes it a ...
Swift

Authentication with signed requests in Alamofire 5

With more than 30k stars on Github, you can tell that Alamofire is a popular framework to use for iOS and Mac projects. It makes network implementations easy to do and it makes certain hard things easier, like retrying a request, authentication layers, or certificate pinning. Alamofire 5 was released ...
Swift

Swift Package Manager framework creation in Xcode

Swift Package Manager is Apple's answer for managing dependencies. We're all familiar with tools like CocoaPods and Carthage but it's likely that we'll all use Swift Package Manager in the near future instead of those. By switching over to the Swift Package Manager (SPM) we also need to know how ...
Swift

Unique values in Swift: Removing duplicates from an array

Removing duplicates to get unique values out of an array can be a common task to perform. Languages like Ruby have built-in methods like uniq but in Swift, we have to create such methods on our own. The standard library does not provide an easy method to do this. There's ...
Swift

JSON Parsing in Swift explained with code examples

JSON parsing in Swift is a common thing to do. Almost every app decodes JSON to show data in a visualized way. Parsing JSON is definitely one of the basics you should learn as an iOS developer. Decoding JSON in Swift is quite easy and does not require any external ...
Swift