Will Swift-based applications work on OS X 10.9 (Mavericks)/iOS 7 and lower?
For example, I have a machine running OS X 10.8 (Mountain Lion), and I am wondering if an application I write in Swift will run on it.
Or what should I have to create a Swift application using Mac OS?
Yes, in fact Apple has announced that Swift apps will be backward compatible with iOS 7 and OS X Mavericks. Furthermore the WWDC app is written in the Swift programming language.
Swift is a robust and intuitive programming language created by Apple for building apps for iOS, Mac, Apple TV, and Apple Watch. It's designed to give developers more freedom than ever.
Swift is available on macOS, Linux, and Windows. This means that you can create Swift applications on these platforms. You don't need a Mac to learn Swift. If you want to build and shipt applications for iOS (and iPadOS), tvOS, macOS, or watchOS, then you need Xcode.
I just tested it for you, Swift applications compile into standard binaries and can be run on OS X 10.9 and iOS 7.
Simple Swift application used for testing:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool { self.window = UIWindow(frame: UIScreen.mainScreen().bounds) var controller = UIViewController() var view = UIView(frame: CGRectMake(0, 0, 320, 568)) view.backgroundColor = UIColor.redColor() controller.view = view var label = UILabel(frame: CGRectMake(0, 0, 200, 21)) label.center = CGPointMake(160, 284) label.textAlignment = NSTextAlignment.Center label.text = "I'am a test label" controller.view.addSubview(label) self.window!.rootViewController = controller self.window!.makeKeyAndVisible() return true }
Swift code can be deployed to OS X 10.9 and iOS 7.0. It will usually crash at launch on older OS versions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With