Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do Swift-based applications work on OS X 10.9/iOS 7 and lower?

Tags:

xcode

macos

swift

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?

like image 355
MeIr Avatar asked Jun 02 '14 19:06

MeIr


People also ask

Will Swift based applications work on OS X 10.9 Mavericks )/ iOS 7 and lower?

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.

Does swift work on Mac?

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.

Do you need a Mac to run Swift?

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.


2 Answers

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 } 
like image 179
Leandros Avatar answered Sep 21 '22 18:09

Leandros


Swift code can be deployed to OS X 10.9 and iOS 7.0. It will usually crash at launch on older OS versions.

like image 32
Greg Parker Avatar answered Sep 19 '22 18:09

Greg Parker