WireGuardApp: Use Bundle.forInfoDictionaryKey to access Info.plist fields

Signed-off-by: Andrej Mihajlov <and@mullvad.net>
This commit is contained in:
Andrej Mihajlov 2020-12-14 16:25:12 +01:00 committed by Jason A. Donenfeld
parent 761f635e16
commit 92517bd21e
1 changed files with 2 additions and 2 deletions

View File

@ -146,8 +146,8 @@ extension SettingsTableViewController {
cell.copyableGesture = false
cell.key = field.localizedUIString
if field == .iosAppVersion {
var appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown version"
if let appBuild = Bundle.main.infoDictionary?["CFBundleVersion"] as? String {
var appVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "Unknown version"
if let appBuild = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String {
appVersion += " (\(appBuild))"
}
cell.value = appVersion