Swift Around the Web
Swift Style Guide: April 2015 Update
While I'm not a big fan of having a super strict style guide for Swift (it's less than a year old and changing!), I find this style guide to include great tips that will improve your Swift code readability. And of course I use the same or very similar conventions as the Ray Wenderlich team, so I approve :)
If you're newer to Swift, this is a great read to get you writing nice "Swifty" code without having to go through the experimentation pain of those of us who've been writing Swift "for a while". Check out the full style guide on Github here.
Failable initializers, revisited
Just because we have the option to create failable initializers in Swift, and it might seem like the "easy" solution to a problem like parsing JSON, Jesse Squires argues (very effectively) that we should avoid failable initializers in most cases and provides an elegant must-read example of a more thoughtful "simple" solution to your problem. Love the last paragraph:
"Next time you find yourself wanting to write init? instead of init, there is likely a way to avoid it with a more thoughtful design that will push optionals and failure states further toward the edges of your object graph. Remember, where we choose to fail does matter."
Coding
Step Counter in HealthKit
I walked a lot on my vacations, and I can say I was pretty disappointed by the way Apple's Health app visualizes my daily steps. Might be time to create my own Step Counter...
Apple News
Increasing Performance by Reducing Dynamic Dispatch
I finally understand the deal with final. Thanks Apple! Make sure to scroll down and read the last section. If you don't want to keep putting final everywhere for faster internal code, make sure to turn on the Whole Module Optimization option!
Design
Start Thinking About Force Touch in iOS Today
"It seems very likely Apple’s Force Touch technology (with its sister Taptic feedback engine) will come to a future iPhone, possibly whichever iPhone launches in the Fall of 2015." I'll be interesting to see how the Force Touch enhances the experience on the Apple Watch. I'll be honest - when I was playing with the Apple Watch yesterday, I didn't even think about Force Touching it. I see lots of annoying "force touch to X" in-app tutorials if it actually comes to iOS...
The Invisible Design Behind the Apple Watch's Many Faces
Playing with the Apple Watch yesterday, I unfortunately have to agree with @Spacekatgal's opinion - it just didn't feel magical. I had to get the store associate to come and tell me how to get back to the home screen and spent way too much time trying to figure out whether to push or double push the digital crown (and I'm pretty sure I still don't understand the interaction!).
That said, the jellyfish and the butterfly that I saw were actually the magical part. I can watch those all day. Looking forward to seeing the flower and the other fascinating watch faces described in this article as well.
Other Cool Stuff
Our iOS app has emoji search
Impressive and Clever. What an amazing little detail in the Instacart app.
In Case You Missed It
AltConf 2015
I'm very honored and excited to be speaking about Swift at AltConf this year! The tickets are completely free and coincide with WWDC, so make sure to get yours now :)
Videos
Natural Language Processing in Swift with Ayaka Nonaka
I haven't heard of NSLinguisticTagger before, but it looks extremely useful and magical. Watch this talk to learn about something cool you probably haven't played with yet!
Testing in Swift with Jeff Hui
Learn about my personal favorite Swift testing framework - Quick -from one of the creators @jeffhui.
Functional Voodoo
JSON + Swift: Functionally Beautiful
Love the diagrams in this presentation explaining some of the hard functional concepts.
Swift Adventures In Monad Land
Learn about the 'M' word in Swift via nice Xcode Playground files. As @cocoaphony said at CocoaConf DC this weekend: "You’ve been using monads all along! The power was within you!"
WATCH
Submitting Your WatchKit App
A great list of tips and solutions to common WatchKit app submission problems... One of the biggest ones is the confusion around provisioning profiles - take a look at this StackOverflow answer for step-by-step instructions that hopefully work for you!
Swift Code
TurtlePlayground - Swift playground using Logo-like commands
Result - Swift type modelling the success/failure of arbitrary operations.
Argo - Functional JSON parsing library for Swift
JSQCoreDataKit - A swifter Core Data stack
WobbleView - An implementation of a recently popular wobble effect for any view in your app
Swift Thoughts
I am the Apple Watch Sport 38mm Silver Aluminum Case with White Sport Band. It's funny how the type of Apple Watch we got has already become part of our identity. At least that's what it seemed like from the excitement on Twitter as everyone was ordering theirs in the middle of the night, and from talking to the amazing iOS devs I met at CocoaConf DC this weekend.
Of course, all of us who ordered the Apple Watch first haven't had a chance to try it on until AFTER we ordered. I tried out the different Apple Watches yesterday, and my favorite one was the Apple Watch 38mm Stainless Steel with Soft Pink Modern Buckle. I did not try it in Rose Gold though...
For those who haven't gotten a try-on appointment, I was surprised to find out that there are a bunch of Apple Watches with actual apps to play with just there in the store (no appointment needed!). One of the things that really stood out to me from playing with Apple's apps was how important the digital crown is for a lot of the UI. Take a look at my video for inputting numbers.
At CocoaConf DC, some of us were discussing the "obvious" apps for the Apple Watch, and of course the tip calculator came up. Using the dial the way Apple did for inputting numbers would be the perfect interface, yet we don't have access to the critical digital crown API yet. Hoping for it at WWDC!