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
Protocols and Swift
Whoa, I must not be using Protocols enough in Swift - I definitely didn't realize that you can't make optional protocol methods (especially since I'm used to seeing the optional keyword when working with UITableViewDataSource and UITableViewDelegate documentation). @ashfurrow's solution to this problem is to separate out the optional methods into their own protocols, which seems clean. Of course, the key is to re-evaluate your code and goals altogether to come up with a better, Swiftier solution. Challenge accepted.
Locks, Thread Safety, and Swift
"An interesting aspect of Swift is that there's nothing in the language related to threading, and more specifically to mutexes/locks. Even Objective-C has @synchronized and atomic properties. Fortunately, most of the power is in the platform APIs which are easily used from Swift." Make sure to scroll down for comments on the topic from @clattner_llvm himself!
Memory management in Swift : Principles, Prevention and Cures.
Topics covered:
- What is ARC and how is it different from Garbage collection.
- Strong reference cycles.
- How to resolved strong reference cycles with weak and unowned references in Swift taking real life examples
- Some of the unobvious (at least for a beginner) causes of memory leaks.
- Prevention/Precautions while coding.
- Cure — Detecting the causes with help of instruments.
- References
Coding
NSProgress with Asynchronous Tasks
"NSProgress was introduced in iOS 7 and OS X 10.9 with the self-proclaimed purpose of being a loosely coupled progress reporting mechanism. In practice this means that intermediary code doesn’t need to know anything about the progress being tracked between the user interface layer where your application is doing work." Sweet!
Prefer Composition to Inheritance
This post is a good reminder to choose the more challenging pattern in favor of architecting more flexible code.
IBInspectable / IBDesignable
Although I was initially excited about IBInspectable / IBDesignable, I just haven't been excited enough to actually use these... It seems like every time I'm interested in trying it out, I have to look up how to get it to work, so I focused on other things instead. But this post makes it look very easy - maybe I should reconsider.
Apple News
iOS 8.2 beta 5 Now Available
iOS 8.2 Beta 5 is out!!! Not too many changes this time, but make sure to check out @_DavidSmith's WatchKit documentation changes. The big thing is the support of remote control events and now-playing Information for audio and video on the iPhone.
Design
God is in the details.
"The details are difficult to include when you’re building a product; they’re expensive both in terms of time and technical overhead — which is why they’re rare." @buzzusborne lays out a few quick and easy wins to start getting your product to feel natural, fun, intuitive, and even make your users feel smart. A very beautiful must-read post.
Other Cool Stuff
The nation's first open-sourced budget.
I'm not too much into government / politics, but having the 2016 U.S. budget on Github is pretty cool.
Tutorials
Securing iOS User Data: Keychain, Touch ID, and 1Password
I was just working on figuring out how to implement Keychain Sharing between my iOS and WatchKit app the other day, and it was much harder than it sounds! There are only a handful helpful resources, so bookmark this tutorial for the future!
Videos
Tiny Networking in Swift (Video)
Quickly create libraries in Swift using simple function composition.
Functional Voodoo
Swift State Machines: Part 2
I love how elegant the code becomes with a simple state machine implementation. While these can get pretty complicated, especially with advanced functional programming involved, this is a very simple and easy-to-follow explanation of how to get started with implementing your own state machine in Swift. Make sure to also check out the follow-up to this post in Part 3.
WATCH
WatchKit Delegates and Contexts
Passing information via contexts in WatchKit is already pretty confusing (it must be AnyObject, so Structs don't work for example). Now what if you want to call it's delegate also? This post walks through the solution, making it easy to see how passing information via contexts actually works.
Tap Distance
A good reminder that the Watch App should not have the same functionality as your iPhone app. Instead, focus on the context of when the user will actually use your Watch App, and make it as easy as possible for him to perform the one action he needs in that context.
Podcasts
Brad Ellis on designing for the Apple Watch
Brad Ellis joins Marc, Seth, and Rene to talk about WatchKit and designing for the Apple Watch, including screen size, remote views, and what makes the most sense.