X-Git-Url: https://git.r.bdr.sh/rbdr/captura/blobdiff_plain/533cd932281300fb444c07e80f81fc683a410b60..ba17de891507da74fb07423803fd636a4457354c:/Captura/Data/SettingsStructs.swift?ds=sidebyside 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 }