Swift Around the Web
The Best of What's New in Swift
Must-read explanation and examples of the new Swift features, including Function Pointers, Protocol Extensions, Error Handling, Guard Statements, and Defer Statements. My favorite part is that @mikeash starts each section with "This is my favorite new Swift feature by far". Awww... that's how I feel about Swift 2 too! đź’–for the Swift team!
Thoughts on Swift 2 Errors
Confused by why everyone is saying Swift error handling is bad / good? @nicklockwood does a great job actually explaining the issues. He covers these three points from his point of view:
1) Why the Swift designers are saying that Swift's new errors are not really exceptions, and why that is both true and false.
2) Why the result enum approach to error handling is not a universal solution for error handling in Swift.
3) What he would have done instead.
Exploring Swift 2.0 OptionSetTypes
An in-depth great explanation with a detailed example walk-through of a new Swift 2 feature that hasn't gotten much press: OptionSetTypes.
Coding
Swift: Asynchronous Error Handling
Now that we've taken a deep look into Swift 2's error handling and figured out how to use it in theory, @ericasadun takes a look at using it in practice... particularly with Cocoa's APIs that include asynchronous completion blocks...
TL;DR: "If you’re working with asynchronous closures, you’ll need to supply ones that do not use throwing signatures. Convert your closures to non-throwing versions by providing exhaustive catch clauses."
Run Xcode 7 UI Tests from the command line
As @flogehring said so well on Twitter: "Don’t worry folks, @KrauseFx is on it" 🚀! Seriously, this is a very clear and helpful post for getting started with the new UI Testing in Xcode 7, launching the tests from the command line, and generating screenshots.
Apple News
Swift Education
When I was in line for the women's restroom at WWDC, a woman behind me, a university professor teaching iOS, mentioned that she attended an Apple event the night before where a college professor announced an open-sourced Swift teaching curriculum. Unfortunately, the line wasn't long enough for me to find out more.
So I was very excited to see this curriculum mentioned (and thoroughly investigated) by @JohnWeatherford in his blog post: Apple has published a great free learn to code course for Swift — on GitHub. It continues to show Apple's huge commitment to putting Swift in the classrooms!
Design
On conversational UIs
Ok, so @justinkan's example this week of how he uses the new popular app Magic is a bit extreme, but you can see this future coming to us paupers in this article on conversational UIs. With the AppleWatch having no way to type, this seems like the logical way forward for a lot of companies.
11 Tips For Designing Apps for Apple Watch
All really good tips, but my favorite one is #9: Adjust your icon for Watch. Love the example of Apple's camera icon on the iPhone vs Watch!
Other Cool Stuff
In Case You Missed It
While looking through slides for What’s New in Swift yet again, I’ve decided to instead play around with and write down the new Swift 2 idioms for easy reference for myself (and hopefully others). Enjoy!
How to Install an Earlier Version of a CocoaPod
I’ve only used CocoaPods to level up to the latest version of whatever library I’m using. However, now with Swift support, I’ve found that I have to use a previous version of a CocoaPod because I’m still using an earlier version of Swift in my project...
Tutorials
How to Create a CocoaPod in Swift
I've finally gotten to installing Swift-based libraries via CocoaPods last week, and it's been magical! If you have a Swift library but haven't made it available via CocoaPods yet, take a look at this great tutorial! Your users will thank you :)
Videos
This week, @realm released more videos from Swift Summit, with two of them focused on Education + Swift:
Functional Voodoo
Swift Exceptions are Swifty: Part 1
A look at Swift 2 error handling from a functional programming perspective.
Three Useful Monads
This beautiful post is from a while ago, but it was pointed out to me by one of the speakers at UIKonf, and I wanted to include it for those of you (including me!) who are still trying to figure out what a monad is. Also take a look at Functors, Applicatives, And Monads In Pictures.
WATCH
Apple Watch Hackathon 2015
I wasn't able to attend, but the Apple Watch Hackathon that happened on Saturday after WWDC definitely brings out some FOMO. This is a great write-up (with pictures) of what everyone hacked on. So many cool hacks I would never have even imagined! Can't wait to see what we all build with the power of WatchOS 2 as we have more time to play with it!
File Coordination Fixed!
In case you missed it, you can now use the NSFileCoordinator and NSFilePresenter APIs to share data between your iOS app and WatchKit extension in iOS 8.2 or higher! More context here.
Swift Code
DVR - Network testing for Swift. Read the blog post here.
UIStackView-Playground - A playground demonstrating some of the key features of UIStackView
ZLSwipeableViewSwift - A simple view for building card like interface like Tinder and Potluck.
DynamicColor - Yet another extension to manipulate colors easily in Swift
BubbleTransition - A custom modal transition that presents and dismiss a controller with an expanding bubble effect.
Business
Inside iOS 9 Search: Apple’s Plan for More Connected Apps
"For developers, the adoption of search encompasses multiple aspects of app and web design. While it's not hard to imagine that most developers will want to start offering content from their apps as search results, some of them will have to carefully consider the benefit of exposing information to users."
Swift Thoughts
As I was catching up on WWDC15 session videos this weekend during meal-times (I really need to have more meals!), I especially enjoyed the Designing for Apple Watch Session. I really loved all the subtle details discussed to make the experience on the Apple Watch so seamless, especially between the hardware and software. Apple has created a platform for us to create absolutely beautiful experiences yet again!