Lotus@ 2014-06-02 19:25 采纳率: 100%
浏览 530
已采纳

基于 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 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line