Swift Around the Web
Swift: Occam’s Code Razor
I love that Swift infers enum types for me, so I don't have to retype them over and over again and can just use .EnumOption
everywhere instead. To me, that makes code more clear and readable. However, I did not know that Swift infers Class names as well! So you can write view.backgroundColor = UIColor.redColor()
as view.backgroundColor = .redColor()
!
3 Nuances of Swift Extensions
This is a good walk-through of the surprises and confusion that could be caused by Swift's access controls: private, internal, and public. Make sure to read the updated post for clarity.
Coding
Open Sourcery
I've noticed a recent trend of iOS developers open sourcing their iOS apps, and it's happening more with WatchKit (see some of the libraries in the Swift Code section!). In this case, iOS developer @mxcl is open sourcing his store-published apps and you can follow along and learn from his process.
A First Look at ReactiveCocoa 3.0
I'll admit that I haven't looked into ReactiveCocoa much, although there's lots of hype around it and I really like the idea behind it. That said, Swift seems like the great tool for it (much better than Objective-C at least), so it's cool that ReactiveCocoa team is working on a brand new Swift API. @ColinEberhardt provides a fascinating preview of the Swift-based beta release.
Apple News
Memory Safety: Ensuring Values are Defined Before Use
"The primary technique employed by Swift is to use our advanced compiler to perform dataflow analysis of the code. The compiler then enforces that each variable was initialized before it is used, a strategy known as Definitive Initialization."
Your heart rate. What it means, and where on Apple Watch you’ll find it.
This is a reminder that the heart rate tracked by the Apple Watch is accessible to us as developers via HealthKit. Here is a HealthKit tutorial (with sample code) I wrote last year.
Design
Custom Watch Faces
A great explanation and analysis about why Apple won't open up a Watch Faces API for a while. Although it's tempting to be annoyed at this, I got to say, the current Apple Watch Faces are absolutely stunning (make sure to read this fascinating article to get an idea how much effort was put into each one). Now compare to these Android watch faces to get a better feel for why Apple is taking their time with the Watch Faces API.
Design an Apple Watch App: Glance
I've found myself looking at Glances a lot more on the Apple Watch than actual Apps. However, not all Glances are useful or well-designed. This is a great guide for designing and making a must-have Glance.
Other Cool Stuff
Videos
Design and Animation
@mrhamzasidd provides a very clear and simple demo of how to use Sketch, After Effects, and Xcode to craft the animation used in the Uber watch app. Hey, even I can be a designer now!
Ruthlessly Simple Dependency Management
"This talk explains what Carthage is and how to use it, then dives into the philosophy of ruthless simplicity that inspired the project. We compare and contrast Carthage with CocoaPods, the original dependency manager for Cocoa. Finally, we explore how Carthage is architected under-the-hood, and the benefits we’ve seen from writing it completely in Swift."
Functional Voodoo
Functional Programming in Swift
Functional programming concepts explained very well by an OO iOS developer learning Haskell to understand Swift.
WATCH
Jared’s Code Signing Tips: Apple Watch Edition
If you've been enjoying iOS code signing (sarcasm), you'll love dealing with it in your Apple Watch app... in the same way you love going to the dentist. Well, Jared makes your life a little less painful with these handy tips and tricks when it comes to getting your Apple Watch app on an Actual Damn Watch!
Swift Code
Project-RainMan - Open Source Weather App created with Swift
WatchScreenshotMagic - Quickly generates perfect Apple Watch screenshots.
swift-ascii-art - Swift program that creates ASCII art from an image
WWDC - WWDC app for OS X
QZCircleSegue - QZCircleSegue is written in Swift and it is a beatiful transition between circular-shapped buttons and your View Controller.
Business
Use the iTunes Affiliate Program. It’s Worth it.
It's very easy to forget about the iTunes Affiliate Program as a source of income... Great reminder.
Swift Thoughts
"A WatchKit app complements its containing iOS app; it does not replace it. If you measure interactions with your iOS app in minutes, you can expect interactions with your WatchKit app to be measured in seconds. So keep interactions brief and interfaces simple." - Apple Watch Human Interface Guidelines.
We finally get to use the Apple Watch! One of the things I've noticed, however, is that too many apps try to be the iPhone app on the Watch. However, others provide the wrong or not enough information. That's fine, since we're all just starting out with this new platform, but hopefully we'll find the right balance sooner rather than later as we keep using the beautiful hardware.
It's going to be a long but very fun journey as our understanding of the platform and the platform itself keeps developing. Bon Voyage!