S Link
Migrating to Swift for iOS Developers
5-day class for iOS developers: Migrate your own Obj-C app to Swift, and explore new iOS 8 features. First class led by Homebrew pro developer Max Howell.
Swift Around the Web
Real World Swift
Great retrospective of Swift from Duolingo after releasing a Swift-based app into the wild. This is my favorite thought: "When Swift was released, many people looked at the syntax of the language and drew comparisons and conclusions. Some said that now that they "don't have to put up with Objective-C's syntax anymore", they could jump into iOS development. Quite frankly, that seems like the wrong way to look at it. Who cares about syntax (as long as it's somewhat reasonable)? There are much more important aspects to a language, such as allowing you to express your concerns easily, and not encouraging bad behavior."
Starting to love Swift
I feel the same way... "So, either Swift has made it easier for me to use functional techniques for manipulating arrays - or its just a coincidence that I'm becoming more comfortable with this approach at the same time as I'm learning Swift - and I'm incorrectly attributing it to Swift. But that's how love works, right? Maybe I'm just so enamoured with Swift I'll give it credit for everything."
Apple's New Programming Language Is Growing Like Mad
Wohoo! Go Swift! "Since it was introduced last summer, Swift just jumped from number 68 to number 22 in the language rankings from research and analyst firm RedMonk. The rankings seeks to gauge how interested programmers are in different languages. That growth is unprecedented in the firm’s rankings, analyst Stephen O’Grady wrote in a blog post about the findings. By comparison, Google’s programming language Go, introduced in 2009, only just broke into the top 20 this quarter."
Coding
Objective-C's Designated Secret
Apparently there is such as thing as official Designated Initializers in Objective-C! I'm glad Swift has promoted designated initializers to be first class citizens: "Any custom initializer you define (using the init keyword) is assumed to be a designated initializer. You can mark your initializers as not designated using the convenience keyword."
Interviews
The latest issue of objc.io is a bit different - it includes interesting interviews from a few iOS developers (including me!):
Playing with Numbers in Global Playgrounds
A look at playing with numbers - units and currency - in the Playground using different locales. "Any time you want to display numbers to humans, you are likely to need the number formatter. Putting dots, commas, spaces or other marks in the number to separate thousands, groups or decimals is hard work, so let the number formatter do it for you."
Apple News
Other Cool Stuff
Pretty excellent zoetrope video here
Last week, I discussed @andy_matuschak's zoetrope analogy when thinking about when to use values vs objects in Swift. As inspiration, @jesse_squires shared a really cool 3D zoetrope video that I thoroughly enjoyed and hope you will as well!
Videos
WatchKit UI Component Walkthrough
This is a super simple walk-though of WatchKit UI Components. I definitely learned about some components that I just didn't notice (e.g. did you know there's a separator component?!).
Building Modular iOS Apps
Coursera engineer Mustafa Furniturewala walks through dynamic frameworks, Swift and new iOS8 SDK features that help build modular iOS apps.
Functional Voodoo
Functional View Controllers
Really cool proof of concepts for a more isolated and testable implementation of ViewControllers.
Monads
If you're tired of Monad abstractions, this post goes through very concrete code examples in Swift to explain the laws of Monads. I personally found this very helpful.
Choosing the Best Expression
This is a good reminder to really think about readability of your code vs focusing on writing something more concise but possibly more obscure to understand at first glance. In this case, @optshiftk talks about the Optional<T>.map shortcut, and how to achieve the same conciseness in a way that makes it obvious that nil could be returned.
WATCH
Instagram for the Apple Watch
@dylan36032 open-sourced an Instagram for the Apple Watch. Definitely check it out! Features include:
- OAuth Login in phone app
- See your instagram feed
- Double tap to like / unlike
- Fancy animations
- Overview page for user profiles
Newest iOS 8.2 beta spills the beans on more Apple Watch features
"For starters, users will be able to customize the watch's home screen from their phones, using a mockup UI not unlike the one used in iTunes to customize an iPhone or iPad's home screen. The Stocks app, at least, will be able to display a single stock persistently on your watch face, and one assumes that something like this could be opened up to other apps in the future as well."
Swift Code
SwiftFilePath - Simple and powerful wrapper for NSFileManager.
BubbleControl-Swift - a bubble control highly inspired from facebook chat heads. written in swift
GPaperTrans - Yet another UICollectionView layout transitions inspired by Facebook Paper App in Swift
DragDropCollectionView - A UICollectionView which allows for easy drag and drop to reorder cells. Mimicks the drag and drop on the iOS when reordering apps (wiggle animation included!). Done entirely in Swift
PullToRefreshSwift - iOS Simple Cool PullToRefresh Library. It is written in pure swift.
VMFloatLabel - Swift based UITextField subclass with floating labels
Swift Thoughts
This weekend, I attended PennApps, a massive college hackathon with students attending from all over the world. One of the things that really stood out was the variety of hardware devices used - Pebbles, Oculus Rifts, Myo Bands, Drones, and Arduinos were very popular.
One team combined a Myo Band with Oculus Rift to create a really fun game of fruit ninja! Another team powered their drone with a ukulele.
I looked at a lot of Pebble Watch apps for Apple Watch inspiration, and honestly most would not be possible on the Apple Watch at this time.
For example, one project involved showing a false time for those who need the watch to be 5-10 minutes faster to get places on time. Since the Apple Watch has a status bar with the real time on it and there is no way to remove it yet as far as I can tell, this simple time app wouldn't work.
One student asked me whether she could draw on the Apple Watch - she wanted to create a writing app for Chinese characters - of course drawing is not yet supported even though it was featured when the Apple Watch was first announced.
I know that all these features are coming to the Apple Watch eventually. It's just frustrating to see all these cool apps on other platforms, and not being able to make them on the Apple platform yet.