Custom Operators in Swift with considerations for readability

Custom operators in Swift create extensions on existing types and can be great for readability improvements if used correctly. Considerations with custom operators For code solutions in your project, you’re probably more likely to define a custom method instead of a custom operator. With the right knowledge and considerations, you can easily create more readable … 

 

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 … 

 

ReactiveCocoa and cancellable delayed blocks

Using ReactiveCocoa in your projects can bring up some really nice solutions. I’m using it a lot and I’m creating more and more custom RACSignals for cool solutions to problems. One of these solutions is cancellable delayed blocks cancellable delayed blocks Sometimes you want to create delayed blocks. Blocks which will fire after a certain … 

 

Protocol extensions and typed arrays

Swift 2.0 introduces protocol extensions, aswel as typed array extensions. This makes it possible to extend an array containing a specific type or even add methods to class inheriting a specific protocol. Typed array protocol extensions With typed array extensions you can create methods for Arrays containing a specific type only. For example, if you …