On Xcode, you can decide the "Deployment Target" by yourself, but you may choose too old version to run the app stably since some of methods in your code are supported by later version of iOS. (e.g. choose Deployment Target 8.0, but when you run the app on a device with iOS version 8.0, the app crashes)
Is there any good way to decide the best Deployment Target, or some tools which can scan the whole code to know the minimum version of iOS?
Thats actually a new feature of Xcode 7
and Swift 2.0
see from swift website:
On the website it states, under Availability
Swift 2.0 has built-in availability checking to make it easy to build the best possible app for each target OS version. The compiler will give you an error when using an API too new for your minimum target OS
来源:https://stackoverflow.com/questions/31720554/swift-how-do-you-decide-the-optimal-deployment-target-for-your-ios-app