基于Swift的应用程序能否在OS X 10.9(Mavericks)/iOS 7及更低版本上运行?
例如,我想知道我是否会在Mountain上运行Swift应用程序.
或者,我应该如何使用Mac OS创建一个Swift应用程序?
基于Swift的应用程序能否在OS X 10.9(Mavericks)/iOS 7及更低版本上运行?
例如,我想知道我是否会在Mountain上运行Swift应用程序.
或者,我应该如何使用Mac OS创建一个Swift应用程序?
我刚刚为您测试了它,Swift应用程序编译成标准二进制文件,可以在OS X 10.9和iOS 7上运行.
用于测试的简单Swift应用程序:
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
}