📜  swift 5 获取应用程序版本 - Swift 代码示例

📅  最后修改于: 2022-03-11 15:01:01.981000             🧑  作者: Mango

代码示例3
import Foundation

let versionString = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "Default String to shut up warning"
let buildString = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String ?? "Default String to shut up warning"