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

前端之家收集整理的这篇文章主要介绍了swift 获取app版本号及 ios 版本号前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

func versionCheck(){

letinfoDictionary = NSBundle.mainBundle().infoDictionary

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

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

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

let appversion = majorVersionasString

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

letidentifierNumber = UIDevice.currentDevice().identifierForVendor//设备udid

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

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

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

println(appversion)

}





majorVersion 主程序版本号

minorVersion build 版本号
原文链接:https://www.f2er.com/swift/323549.html

猜你在找的Swift相关文章