Prepend team name to shared user defaults to get rid of warning and hopefully prevent user default corruption

This commit is contained in:
Maurice Parker 2019-10-10 14:44:20 -05:00
parent 458f79871f
commit f57d3f7df8
1 changed files with 5 additions and 1 deletions

View File

@ -10,7 +10,11 @@ import UIKit
struct AppDefaults {
static var shared = UserDefaults.init(suiteName: "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)!
}()
struct Key {
static let lastImageCacheFlushDate = "lastImageCacheFlushDate"