一:获取软件版本号
let appVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString")
二:获取系统信息
// 直接获取大版本
let sys1Version = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion")
// 更加详细
let sys2Version = NSDictionary(contentsOfFile: "/System/Library/CoreServices/SystemVersion.plist")
网友评论