Make sure suite name is initialized before using it
This commit is contained in:
parent
3f81cd9b96
commit
fa24e8a863
@ -10,12 +10,9 @@ import UIKit
|
|||||||
|
|
||||||
struct AppDefaults {
|
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 {
|
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)!
|
return UserDefaults.init(suiteName: suiteName)!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user