S Link
iOS Developer at Basecamp (formerly 37signals)
Basecamp is looking for an experienced iOS developer to join our mobile team. Now is your time to shape the future of Basecamp on iOS and do the best work of your career.
Swift Around the Web
Testing Swift's ErrorType: An Exploration
Hopefully XCTest will make it much easier to test the new Swift 2.0 error throwing in the future, but for now we're stuck with some ugly solutions, especially when there are multiple possible errors to be thrown. @mrackwitz explores one super useful solution to this problem..
Protocols - My Current Recommendations
As we transition our brains from Object-Oriented Programming to Protocol-Oriented Programming, we'll have to let our brain hurt a little as we try to stay away from using protocols in an object-oriented way. @owensd walks through two detailed examples of what to avoid when creating your protocols:
- Don’t treat protocols as a type
- Don’t make your protocols generic unless you really have too!
Coding
How to test UI changes in Xcode 7
Apparently, as of Xcode 7 Beta 4, UI testing got the ability to wait asynchronously for view changes! Of course I'd prefer to NOT have to use a predicate-based system, but at least this much-needed functionality is available to us... that's a good start!
iOS Live Camera Controlled Particles in Swift & Metal
@FlexMonkey is seriously a magician to me!
ParticleCam is a small app that takes the luminosity layer from the device's rear camera and passes it into my particle shader. In the shader code, I look at the value of each particle's neighbouring pixels and, after a bit of averaging, adjust that particle's linear momentum so that it moves towards brighter areas of the camera feed.
Watch the beautiful video result here! Oh, and the source code is on Github here.
Apple News
Xcode 7 beta 5 Now Available
Xcode 7 beta 5 is OUT!!!! Release notes here. And here is the Swift feature I'm most excited about (thx @allonsykraken for pointing this out):
Dictionary's
removeAtIndex(_:)
method now returns the key-value pair being removed as a two-element tuple (rather than returningVoid
). Similarly, Set'sremoveAtIndex(_:)
returns the element being removed.
Of course, a close second is that XCTAssertEqual
now supports optionals!!!!
You can find additional summaries of the changes from @ericasadun's Jive with Beta Five and @xenadu02's Swift 2, Beta 5 blog posts.
Design
Mobile: 2015 UI / UX Trends
A beautiful article outlining the Whats and Whys of the latest in Mobile UI / UX Trends. The common thread is to keep your app super simple - fewer colors, fewer fonts, fewer screens - yet, create a rich experience via space, sizes, gestures and motion. Love it!
Other Cool Stuff
Drawing
Here is your Monday morning inspiration from @ashfurrow. A question to ponder: "What other things are there that 'I can’t do', but I’ve never really tried?"
In Case You Missed It
Let It Go: Late Initialization of Let in Swift
Swift 1.2 introduced the ability to initialize let
constants a little later in the code, before they're actually used. While I knew about this conceptually, I kept using var
out of habit. Thanks @allonsykraken for pointing out at least one common use-case where I get to now use let
instead of var
. I'll have to re-think and break my var
habit moving forward!
Tutorials
Introduction to UIStackView
In case you haven't had a chance to play with UIStackView yet, this is a great introduction with handy visuals. Just when I think I have a good feel for Autolayout, it fails me (guess what I did on Friday!). So I'm really excited to switch to UIStackView. Hopefully it will solve all our problems...
Functional Voodoo
The best FRP in iOS links.
Ready to venture into the challenging world or Functional Reactive Programming in iOS (or at least be able to understand what FRP even means when others talk like they know everything about it?!), here is the super useful list of resources to get you more than started. Enjoy!
WATCH
Using Cocoapods with watchOS 2
Two big take aways here:
- You can install CocoaPods on WatchOS 2 🎉
- Apparently watchOS is it's own platform (obvious in retrospect). So CocoaPod creators will have to make sure watchOS is supported.
Swift Code
Swift-Diagram-Playgrounds - Drawing diagrams in Swift using a recursive enum data structure
DOFavoriteButton - Cute Animated Button written in Swift.
Toucan - Fabulous Image Processing in Swift
TextFieldEffects - Custom UITextFields effects inspired by Codrops, built using Swift
Ji - XML/HTML parser for Swift
Swift Thoughts
Last week, I attended @allonsykraken's talk on Weak, Strong, and Unowned in Swift at the Swift User Language Group meetup. You can read the blog post version here or sign up for the video version notification here.
One big take-away for me was that unowned is not what I think it is! It is safer to use weak in most cases. And of course there are actually cases where strong is the way to go (like in the UIView animation block). I'll have to re-read that blog post and watch the video a few more times to get a better grasp on the differences.
The worst position to be in as a developer is being convinced that you know something when you actually don't! Glad my knowledge on this subject was challenged, and I now know that I need to explore this topic a lot more. Happy Learning!