X-Git-Url: https://git.r.bdr.sh/rbdr/captura/blobdiff_plain/a4e804275517af683afa1733e2db7c383c306f2b..8e9321304ca80e9ada7ac01058a5f4603cb37fab:/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 }