10.24 2014-06-02 19:25 采纳率: 0%
浏览 482
已采纳

基于 swift 的应用程序能在 OS x 10.9 / ios7和更低的版本上运行吗?

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.

转载于:https://stackoverflow.com/questions/24001778/do-swift-based-applications-work-on-os-x-10-9-ios-7-and-lower

  • 写回答

17条回答 默认 最新

  • ~Onlooker 2014-06-02 20:11
    关注

    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
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(16条)

报告相同问题?

悬赏问题

  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程