首页 > 代码库 > 如何获取Info.plist文件信息

如何获取Info.plist文件信息

swift:

NSBundle.mainBundle().infoDictionary?["CFBundleShortVersionString"]

比如:

        if let version = NSBundle.mainBundle().infoDictionary?["CFBundleShortVersionString"] as? String {
            versionLabel.text = "Version. \(version)"
        } else {
            versionLabel.text = "Version. 1.0.0"
        }


如何获取Info.plist文件信息