Generics and the Art of Inference Part 1 of 3

The power of inference in Swift generics is something I find most people underestimate and underuse. Personally generics and inference has saved me from writing tons of boilerplate and duplicated code. In any case there is a ton I’d like to share about this topic, but to begin here are a couple common cases where […]

Trying to Build a Better Hashable

The standard example: You have a type that is uniquely identifiable by an id property and want to be able to use contains on a collection of this type, while not worrying so much about having duplicates. For a single struct, we can conform to Hashable and implement a == case to handle the object. […]

Swift Gist Favorites of 2015

Taking a look back recently, I realized a lot of my Swift sharing has been in the form of gists and less in the form of blog. As thus, here is a breakdown of my top three Swift gists since 2.0 came out. 3 – Optional Array Accessor This is an array accessor that returns […]

Cast-Free Arithmetic

Updates: 10/13/2015 I recently gave a presentation on this topic @Realm, available in video format here. Cast-Free Arithmetic Part 1: Two months ago when WWDC week was happening and while many attendees were going to lectures, mingling at parties, and networking, I was resolved to take a deep dive into Swift 2.0 as quickly as […]

Recreating Defer Syntax in Swift 1.2

So, a few days ago, I had the bright idea that trying to recreate some of the shiny new Swift 2.0 features in Swift 1.2 might amount to a fun challenge. I first thought about recreating guard syntax, but quickly got stuck at finding a way of calling return in the scope of a function […]