While Swift does not yet feature a dedicated namespace keyword, it does support nesting types within others. Let’s take a look at how using such nested types can help us improve the structure of our code.
While Swift does not yet feature a dedicated namespace keyword, it does support nesting types within others. Let’s take a look at how using such nested types can help us improve the structure of our code.
Most apps written for any of Apple’s platforms rely on APIs that are singleton based. From UIScreen to UIApplication to NSDate, static APIs are everywhere in Foundation, UIKit & AppKit. In this post I give 3 easy steps to easily test code that uses such APIs.
Dependency injection is a great technique for decoupling code and making it easier to test. In this blog post I take a look at how functions can be used for simple dependency injection.
After diving into one of our largest Swift projects at Hyper, I managed to reduce the average build time for a clean build by 20%. This blog post is detailing how I did it.
How to use custom, lazily evaluated sequences in Swift to improve performance and enable you to deal with larger datasets, such as entries in a database.
How type erasure can be implemented using closures, and how it can help you work around using protocols with self or associated type requirements.
I’d like to share a technique that I’ve come to find quite useful when using Swift’s do, try, catch error handling model — to limit the amount of errors that can be thrown from a given API call.