logo

Matt Wyskiel

Swift 2.0 and the State of my SwiftSystem Project

June 9, 2015

The WWDC 2015 keynote has come and gone. There were great announcements, from iOS 9 and OS X El Capitan, to watchOS 2 and even the unified Developer Program. I am not here to talk about any of those announcements; I'm here to talk about Swift.

You may remember a post I wrote in February that described the ideal Swift-ified system frameworks for the Cocoa SDKs. I had also posted a tweet with a preview of the proposed library I was working on. With the announcement of Swift 2, almost none of that is necessary enough to invest time in making a library. Here's why:

  • Lightweight Generics in Objective-C provide a way to provide the type of NSDictionary, NSArray, or NSSet objects, so that Swift knows the type of the array, dict, or set that the Objective-C API is working with.
  • There is a brand new error handling system that is meant to be a modern, better version of the NSError pointer system. This eliminates the immediate need to find a better way to handle errors and the methods that throw them via a third party i.e. BlocksKit.
  • Nullability annotations in Objective-C allow the Swift compiler to determine the nullability of a certain type in its context. No more implicitly unwrapped optionals!

With these three issues taken care of by the good folks at Apple, now this project is unnecessary; it would be just some typealiases and BlocksKit. Not worth making an entirely new library.

I am very thankful that Apple got the message about these user experience issues that seemed to stick out like a sore thumb. I am very excited to begin testing and developing with these improvements.