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 版本號