Testing API availability with Swift 2.0

With Swift 2.0, Apple introduced the #available syntax for declaring code only usable in specific iOS versions. This is much improved from previous solutions but the default approach makes it hard to test. This post will show a technique to write testable iOS 9 only code. Let’s start with an app that creates a Spotlight Search….

Read more

Stylish Devs Guide to Swift References (AltConf)

Thanks for watching. I hope you learned something new. I had to skim some material to fit the 30 minute time slot at AltConf. No worries, there are other excellent resources that cover these things in greater details. Swift Style and Usage iPhreaks (Podcast) with Dave Mauro iPhreaks (Podcast) with Natasha the Robot Structs (immutability)…

Read more

Should your team switch to Swift?

This is for business owners and technical leaders trying to deicide if they adopt Swift for their development. It will show the criteria I use to judge if Swift is right for an organization or team.   The backstory Swift was announced with much fanfare last June (2014) at WWDC in San Francisco. Everyone ran around…

Read more

Testing Singletons in Swift – Property Injection

In a previous post we showed how to test Singletons with Constructor Injection. This will show another technique using Property Injection. Property Injection is useful in cases where a custom init method isn’t practical. A useful case for this is testing ViewControllers created by a Storyboard. So what’s the difference? Instead of injecting the dependencies…

Read more

Testing Singletons in Swift

Singletons are the scourge of good software design. But everyone uses them, especially in iOS development. This post will show one way to make singletons testable in Swift applications. Let’s be real, we’re not building web apps. Long running objects are part of the game for client development. State happens. Singletons are a simple way to…

Read more