func requestCurrentVersion() {
let infoDictionary : [String : Any] = Bundle.main.infoDictionary!
let appName : Any = infoDictionary["CFBundleDisplayName"] // 程序名称
let mainVersion : Any = infoDictionary["CFBundleShortVersionString"] as Any // 主程序版本号
let minorVersion : Any = infoDictionary["CFBundleVersion"] as Any // 版本号(内部标示)
// 设备信息
let iosSystemVersion : NSString = UIDevice.current.systemVersion as NSString // ios版本号
let udid = UIDevice.current.identifierForVendor // 设备udid
let deviceName = UIDevice.current.systemName // 设备名称
let deviceModel = UIDevice.current.model // 设备型号
let localizedModel = UIDevice.current.localizedModel // 设备区域化型号
let appVersion = mainVersion as! String
print(appVersion)
}
借鉴学习并记录一下
网友评论