diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-07-31 16:58:57 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-07-31 16:58:57 +0200 |
| commit | ba17de891507da74fb07423803fd636a4457354c (patch) | |
| tree | bdc75cff26dfce9bb67679e48ce09cc41817b506 /Captura/Data/SettingsStructs.swift | |
| parent | 533cd932281300fb444c07e80f81fc683a410b60 (diff) | |
Allow URL configuration
Diffstat (limited to 'Captura/Data/SettingsStructs.swift')
| -rw-r--r-- | Captura/Data/SettingsStructs.swift | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Captura/Data/SettingsStructs.swift b/Captura/Data/SettingsStructs.swift index 99f407c..16172ca 100644 --- a/Captura/Data/SettingsStructs.swift +++ b/Captura/Data/SettingsStructs.swift @@ -5,6 +5,19 @@ enum OutputFormatSetting: Int { case mp4Only = 1 case all = 2 + init?(_ string: String) { + switch(string) { + case "gif": + self = .gifOnly + case "mp4": + self = .mp4Only + case "all": + self = .all + default: + return nil + } + } + func shouldSaveGif() -> Bool { return self == .gifOnly || self == .all } |