From 92517bd21e794282c4ac7a9a0dbc80b6c3fec958 Mon Sep 17 00:00:00 2001 From: Andrej Mihajlov Date: Mon, 14 Dec 2020 16:25:12 +0100 Subject: [PATCH] WireGuardApp: Use Bundle.forInfoDictionaryKey to access Info.plist fields Signed-off-by: Andrej Mihajlov --- .../UI/iOS/ViewController/SettingsTableViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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