struct CapturaSettings {
static var frameRate: Int {
get {
- UserDefaults.standard.integer(forKey: "frameRate")
+ if UserDefaults.standard.object(forKey: "frameRate") == nil {
+ return 10
+ } else {
+ return min(10, max(4, UserDefaults.standard.integer(forKey: "frameRate")))
+ }
}
set {
UserDefaults.standard.setValue(newValue, forKey: "frameRate")
static var shouldKeepLocalFiles: Bool {
get {
- UserDefaults.standard.bool(forKey: "keepFiles")
+ if UserDefaults.standard.object(forKey: "keepFiles") == nil {
+ return true
+ } else {
+ return UserDefaults.standard.bool(forKey: "keepFiles")
+ }
}
set {
UserDefaults.standard.set(newValue, forKey: "keepFiles")
}
static var shouldAllowURLAutomation: Bool {
- UserDefaults.standard.bool(forKey: "allowURLAutomation")
+ get {
+ UserDefaults.standard.bool(forKey: "allowURLAutomation")
+ }
+ set {
+ UserDefaults.standard.setValue(newValue, forKey: "allowURLAutomation")
+ }
}
static func apply(_ config: ConfigureAction) {