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. …