From: Andrej Mihajlov Date: Mon, 14 Dec 2020 15:25:12 +0000 (+0100) Subject: WireGuardApp: Use Bundle.forInfoDictionaryKey to access Info.plist fields X-Git-Tag: 1.0.10-18~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=92517bd21e794282c4ac7a9a0dbc80b6c3fec958;p=thirdparty%2Fwireguard-apple.git WireGuardApp: Use Bundle.forInfoDictionaryKey to access Info.plist fields Signed-off-by: Andrej Mihajlov --- diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/SettingsTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/SettingsTableViewController.swift index 5eeea58..4d353b3 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/SettingsTableViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/SettingsTableViewController.swift @@ -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