From fa24e8a863eb62d8f9a1ea984dce266e389f510b Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 25 Oct 2019 12:56:28 -0500 Subject: [PATCH] Make sure suite name is initialized before using it --- iOS/AppDefaults.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/iOS/AppDefaults.swift b/iOS/AppDefaults.swift index 31d006641..09cd6a317 100644 --- a/iOS/AppDefaults.swift +++ b/iOS/AppDefaults.swift @@ -10,12 +10,9 @@ import UIKit struct AppDefaults { - private static var suiteName: String = { - let appIdentifierPrefix = Bundle.main.object(forInfoDictionaryKey: "AppIdentifierPrefix") as! String - return "\(appIdentifierPrefix)group.\(Bundle.main.bundleIdentifier!)" - }() - static var shared: UserDefaults { + let appIdentifierPrefix = Bundle.main.object(forInfoDictionaryKey: "AppIdentifierPrefix") as! String + let suiteName = "\(appIdentifierPrefix)group.\(Bundle.main.bundleIdentifier!)" return UserDefaults.init(suiteName: suiteName)! }