乱世@小熊 2014-06-02 19:25 采纳率: 25%
浏览 468
已采纳

基于 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

  • 写回答

18条回答

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

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?