How can I programmatically find Swift's version?

前端 未结 6 1498
轻奢々
轻奢々 2020-12-01 10:16

I know I can find the version of Swift I\'m running right now reverting to a Terminal and typing:

xcrun swift --version
Swift version 1.1 (swift-600.0.57.4)
         


        
6条回答
  •  眼角桃花
    2020-12-01 10:55

    For iOS :

    var systemVersion = UIDevice.currentDevice().systemVersion;

    For OSX :

    var systemVersion = NSProcessInfo.processInfo().operatingSystemVersion;

    K.

提交回复
热议问题