0

Is there a better way to detect if Swift is supported in the current Xcode project than checking for iOS 8 or OSX 10.10?

#if defined(__IPHONE_8_0) || defined(__MAC_10_10)

I have a mixed Swift/Objective-C codebase with two different Xcode projects.

jpsim
  • 14,329
  • 6
  • 51
  • 68
  • Why do you need to check this? Swift is interoperable with Objective-C. – jtbandes Jun 23 '14 at 23:24
  • Note that you do not need `iOS 8` or `10.9` to use Swift. You can use at least `iOS 6` and `10.4`. http://stackoverflow.com/questions/24001778/do-swift-based-apps-work-on-os-x-10-9-ios-7-and-lower – Eliza Wilson Jun 24 '14 at 00:13
  • Yes the resulting binaries will run on iOS 6 and 10.4, but iOS 8 and/or OSX 10.10 should still be defined at compile time. – jpsim Jun 24 '14 at 03:16

0 Answers0