How can I programmatically find Swift's version?
问题 I know I can find the version of Swift I'm running right now reverting to a Terminal and typing: xcrun swift --version Swift version 1.1 (swift-600.0.57.4) Target: x86_64-apple-darwin13.4.0 Also, I've been reading about the Preprocessor Macros in Swift, but no luck finding a Swift version constant. As Swift 1.2 approaches it will be nice to flag old code that only runs on Swift 1.1 (Xcode up to 6.2) or new code that needs Xcode 6.3 (Swift 1.2) Note: I can also use system() to do something