aboutsummaryrefslogtreecommitdiff
path: root/Captura/Data
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2023-08-02 22:23:48 +0200
committerRuben Beltran del Rio <ruben@unlimited.pizza>2023-08-02 22:23:48 +0200
commite42019cd38b59e757f6036b132614a471d4cf6fe (patch)
tree2c95f67640d01a63ef9696ec23d429b866d87293 /Captura/Data
parent153f3309127a4f9d898310224a467d11eef0f2ff (diff)
Adds configure support for URLs
Diffstat (limited to 'Captura/Data')
-rw-r--r--Captura/Data/CapturaSettings.swift28
1 files changed, 14 insertions, 14 deletions
diff --git a/Captura/Data/CapturaSettings.swift b/Captura/Data/CapturaSettings.swift
index 2d0e70b..578d17c 100644
--- a/Captura/Data/CapturaSettings.swift
+++ b/Captura/Data/CapturaSettings.swift
@@ -3,23 +3,23 @@ import Foundation
struct CapturaSettings {
static var frameRate: Int {
get {
- if NSUbiquitousKeyValueStore.default.object(forKey: "frameRate") == nil {
+ if UserDefaults.standard.object(forKey: "frameRate") == nil {
return 10
} else {
- return min(10, max(4, Int(NSUbiquitousKeyValueStore.default.longLong(forKey: "frameRate"))))
+ return min(10, max(4, UserDefaults.standard.integer(forKey: "frameRate")))
}
}
set {
- NSUbiquitousKeyValueStore.default.setValue(newValue, forKey: "frameRate")
+ UserDefaults.standard.setValue(newValue, forKey: "frameRate")
}
}
static var outputFormats: OutputFormatSetting {
get {
- OutputFormatSetting(rawValue: Int(NSUbiquitousKeyValueStore.default.longLong(forKey: "outputFormats"))) ?? .all
+ OutputFormatSetting(rawValue: UserDefaults.standard.integer(forKey: "outputFormats")) ?? .all
}
set {
- NSUbiquitousKeyValueStore.default.setValue(newValue.rawValue, forKey: "outputFormats")
+ UserDefaults.standard.setValue(newValue.rawValue, forKey: "outputFormats")
}
}
@@ -45,44 +45,44 @@ struct CapturaSettings {
static var backend: URL? {
get {
- if let url = NSUbiquitousKeyValueStore.default.string(forKey: "backendUrl") {
+ if let url = UserDefaults.standard.string(forKey: "backendUrl") {
return URL(string: url)
}
return nil
}
set {
- NSUbiquitousKeyValueStore.default.setValue(newValue?.absoluteString, forKey: "backendUrl")
+ UserDefaults.standard.setValue(newValue?.absoluteString, forKey: "backendUrl")
}
}
static var backendFormat: OutputFormatSetting {
get {
- OutputFormatSetting(rawValue: Int(NSUbiquitousKeyValueStore.default.longLong(forKey: "backendFormat"))) ?? .gifOnly
+ OutputFormatSetting(rawValue: UserDefaults.standard.integer(forKey: "backendFormat")) ?? .gifOnly
}
set {
- NSUbiquitousKeyValueStore.default.setValue(newValue.rawValue, forKey: "backendFormat")
+ UserDefaults.standard.setValue(newValue.rawValue, forKey: "backendFormat")
}
}
static var shouldKeepLocalFiles: Bool {
get {
- if NSUbiquitousKeyValueStore.default.object(forKey: "keepFiles") == nil {
+ if UserDefaults.standard.object(forKey: "keepFiles") == nil {
return true
} else {
- return NSUbiquitousKeyValueStore.default.bool(forKey: "keepFiles")
+ return UserDefaults.standard.bool(forKey: "keepFiles")
}
}
set {
- NSUbiquitousKeyValueStore.default.set(newValue, forKey: "keepFiles")
+ UserDefaults.standard.set(newValue, forKey: "keepFiles")
}
}
static var shouldAllowURLAutomation: Bool {
get {
- NSUbiquitousKeyValueStore.default.bool(forKey: "allowURLAutomation")
+ UserDefaults.standard.bool(forKey: "allowURLAutomation")
}
set {
- NSUbiquitousKeyValueStore.default.setValue(newValue, forKey: "allowURLAutomation")
+ UserDefaults.standard.setValue(newValue, forKey: "allowURLAutomation")
}
}