mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.4 KiB
Swift
56 lines
1.4 KiB
Swift
5 years ago
|
import Foundation
|
||
|
|
||
|
public enum LKUserDefaults {
|
||
|
|
||
|
public enum Bool : Swift.String {
|
||
|
case hasLaunchedOnce
|
||
|
case hasSeenGIFMetadataWarning
|
||
|
case hasViewedSeed
|
||
|
case isUsingFullAPNs
|
||
|
}
|
||
|
|
||
|
public enum Date : Swift.String {
|
||
|
case lastProfilePictureUpload
|
||
|
}
|
||
|
|
||
|
public enum Double : Swift.String {
|
||
|
case lastDeviceTokenUpload = "lastDeviceTokenUploadTime"
|
||
|
}
|
||
|
|
||
|
public enum Int: Swift.String {
|
||
|
case appMode
|
||
|
}
|
||
|
|
||
5 years ago
|
public enum String : Swift.String {
|
||
5 years ago
|
case deviceToken
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public extension UserDefaults {
|
||
|
|
||
5 years ago
|
subscript(bool: LKUserDefaults.Bool) -> Bool {
|
||
5 years ago
|
get { return self.bool(forKey: bool.rawValue) }
|
||
|
set { set(newValue, forKey: bool.rawValue) }
|
||
|
}
|
||
|
|
||
5 years ago
|
subscript(date: LKUserDefaults.Date) -> Date? {
|
||
5 years ago
|
get { return self.object(forKey: date.rawValue) as? Date }
|
||
|
set { set(newValue, forKey: date.rawValue) }
|
||
|
}
|
||
|
|
||
5 years ago
|
subscript(double: LKUserDefaults.Double) -> Double {
|
||
5 years ago
|
get { return self.double(forKey: double.rawValue) }
|
||
|
set { set(newValue, forKey: double.rawValue) }
|
||
|
}
|
||
|
|
||
5 years ago
|
subscript(int: LKUserDefaults.Int) -> Int {
|
||
5 years ago
|
get { return self.integer(forKey: int.rawValue) }
|
||
|
set { set(newValue, forKey: int.rawValue) }
|
||
|
}
|
||
|
|
||
5 years ago
|
subscript(string: LKUserDefaults.String) -> String? {
|
||
|
get { return self.string(forKey: string.rawValue) }
|
||
|
set { set(newValue, forKey: string.rawValue) }
|
||
5 years ago
|
}
|
||
|
}
|