swift3.0版本检测

swift3.0版本检测_第1张图片
swift.jpg

swift3.0版本号获取

func versionCheck(){
    
    let infoDictionary = Bundle.main.infoDictionary
    //app名称
    let appDisplayName: Any? = infoDictionary!["CFBundleDisplayName"] as Any
    //主版本号
    let majorVersion : Any? = infoDictionary! ["CFBundleShortVersionString"] as Any
    //版本号(内部标识)
    let minorVersion : Any? = infoDictionary! ["CFBundleVersion"] as Any
    let appVersion = majorVersion as! String
    print(appVersion)
    //ios 版本
    let iosversion : NSString = UIDevice.current.systemVersion as NSString
    //设备 udid
    let identifierNumber = UIDevice.current.identifierForVendor
    //设备名称
    let systemName = UIDevice.current.systemName
    //设备型号
    let model = UIDevice.current.model
    //设备区域化型号 如 A1533
    let localizedModel = UIDevice.current.localizedModel
}

你可能感兴趣的:(swift3.0版本检测)