swift 获取app版本号及 ios 版本号


swift 获取app版本号及 ios 版本号

func versionCheck(){

        let infoDictionary = NSBundle.mainBundle().infoDictionary

        let appDisplayName: AnyObject? = infoDictionary!["CFBundleDisplayName"]

        let majorVersion : AnyObject? = infoDictionary! ["CFBundleShortVersionString"]

        let minorVersion : AnyObject? = infoDictionary! ["CFBundleVersion"]

        let appversion = majorVersion as String

        let iosversion : NSString = UIDevice.currentDevice().systemVersion   //ios 版本

        let identifierNumber = UIDevice.currentDevice().identifierForVendor   //设备 udid

        let systemName = UIDevice.currentDevice().systemName   //设备名称

        let model = UIDevice.currentDevice().model   //设备型号

        let localizedModel = UIDevice.currentDevice().localizedModel   //设备区域化型号 A1533

 

        

        println(appversion)

    }





majorVersion 主程序版本号

minorVersion build 版本号
 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM