What’s my favorite thing about Swift 3? Not maintaining third-party libraries that make Cocoa more “Swifty”. Swift 3 sherlocked my libraries, and I couldn’t be happier.
Among the many improvements included in Swift 3 are the Swifty API refinements to Foundation and libdispatch.
I have two Swift libraries that I’m officially deprecating today. The first is JSQNotificationObserverKit which provided a generic
Notification struct to wrap the NSNotification APIs. It was sherlocked by proposal SE-0069: Mutability and Foundation Value Types. The second is GrandSugarDispatch which provided Swifty syntactic sugar for Grand Central Dispatch (GCD). It was sherlocked by proposal SE-0088: Modernize libdispatch for Swift 3 naming conventions.
As expected, there a few differences between my libraries and what Apple now provides. In particular, the
Notification struct in Foundation is not generic. However, the differences are not significant enough to justify keeping my libraries around. Plus, as stated in SE-0069, it is much better for the community to have one canonical API whenever possible:
We know from our experience with Swift so far that if we do not provide these value types then others will, often by wrapping our types. It would be better if we provide one canonical API for greater consistency across all Swift code. This is, after all, the purpose of the Foundation framework.
These libraries served their purpose during the pre-Swift 3 era — before The Great API Transformation. But I’m ultimately very happy to see them go. In situations like this, it feels good to get sherlocked. It means that Apple are taking on this responsibility — it shows us once more that the Core Team are listening to the community and responding with solutions.
The more we can agree and settle on canonical APIs and libraries, the better it will be for all of us. Do you have any libraries that have been obsoleted by Swift 3? If so, deprecate them now then sit back and relax. 😄