Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

Exclusive Pre-Launch Offer: Get 20% Off atgoing-indie.com

CompactMap vs flatMap: The differences explained

CompactMap and flatMap, what are the differences and when do you use each? Swift 4.1 introduced this new method with the proposal 0187: Introduce Filtermap to gain more clarity in flatMap use cases. When to use compactMap Use this method to receive an array of nonoptional values when your transformation produces an optional value. See … 

 

Where usage in Swift

Where is a powerful keyword within Swift to easily filter out values. It can be used in many different variants from which most of them are listed in this post. Usage in a switch Consider having the following enum: Using where you can easily filter the case for a specific age range: Usage in a … 

 

Debugging breakpoints as a replacement for prints

Debugging breakpoints in Xcode allows you to replace prints and reuse debugging statements in future debugging sessions. By simply enabling and disabling needed breakpoints you can also get rid of debug levels as often defined in libraries like CocoaLumberjack.   Inspired by @twostraws’s debugging presentation at @AppdevconNL I now keep around breakpoints instead of print … 

 

Typed notifications using custom extensions

The Swift API contains a lot of notifications sent out by the system like NSManagedObjectContextObjectsDidChange in Core Data or the AppDelegate events like UIApplicationDidBecomeActive. Some of these notifications contain rich data in their user info dictionary. Reading the user info data using typed notifications can clean up your code, especially if you use these notifications …