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