How can i compile an app in the latest Xcode that target to lower version of iOS, say iOS10, or iOS9? I have checked and I only can have base SDK 11 in my Xcode. How can i make the code compatible with lower version of iOS?
Asked
Active
Viewed 317 times
2
-
i cannot find out where to set deployment target in the latest Xcode... i did that in the past..but cannot find now... how come.. – user6539552 Sep 24 '17 at 17:03
1 Answers
2
Leave the SDK at iOS 11, but set you app's deployment target (located in "project settings", not "target settings") to be iOS 10 and you're largely done. You just need to avoid iOS 11 specific API (and/or wrap any iOS 11 specific API in if #available(iOS 11, *) { ... }
construct or other equivalent patterns).
This way, you can enjoy the benefits of the latest SDK for devices that are using it, but you can relatively easily support older iOS versions, too. The amount of effort this takes (both coding and testing) increases based upon how far back you go in supporting old iOS versions. But if you go back only one or two major iOS versions, it's generally not too bad.

Rob
- 415,655
- 72
- 787
- 1,044