diff --git a/AnimeGen.xcodeproj/project.pbxproj b/AnimeGen.xcodeproj/project.pbxproj index e365c638..c1691617 100644 --- a/AnimeGen.xcodeproj/project.pbxproj +++ b/AnimeGen.xcodeproj/project.pbxproj @@ -209,8 +209,8 @@ 138C92632BE11887008E37F8 /* API-Pref.swift */, 138C92662BE11CE7008E37F8 /* Features.swift */, 138C92682BE1202D008E37F8 /* Content.swift */, - 138C926A2BE120E3008E37F8 /* Developer.swift */, 1312CFE62BE143B0003E135F /* History.swift */, + 138C926A2BE120E3008E37F8 /* Developer.swift */, 13C6CA762BDA3ABC0046923C /* Developer-Pref */, ); path = "App Settings"; @@ -529,7 +529,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = AnimeGen/AnimeGen.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 33; + CURRENT_PROJECT_VERSION = 38; DEVELOPMENT_TEAM = 399LMK6Q2Y; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = AnimeGen/Info.plist; @@ -564,7 +564,7 @@ CODE_SIGN_ENTITLEMENTS = AnimeGen/AnimeGen.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 33; + CURRENT_PROJECT_VERSION = 38; DEVELOPMENT_TEAM = 399LMK6Q2Y; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = AnimeGen/Info.plist; diff --git a/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate b/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate index caa13e0d..dd55b5b8 100644 Binary files a/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate and b/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/AnimeGen/Settings/App Settings/API-Pref.swift b/AnimeGen/Settings/App Settings/API-Pref.swift index 2fa921db..fd8477db 100644 --- a/AnimeGen/Settings/App Settings/API-Pref.swift +++ b/AnimeGen/Settings/App Settings/API-Pref.swift @@ -70,31 +70,27 @@ struct APIPreferences: View { } Toggle("Load Image on Startup", isOn: Binding( - get: { self.loadstart }, + get: { UserDefaults.standard.bool(forKey: "enableImageStartup") }, set: { newValue in - self.loadstart = newValue UserDefaults.standard.set(newValue, forKey: "enableImageStartup") } )) Toggle("Display Tags", isOn: Binding( - get: { self.tags }, + get: { UserDefaults.standard.bool(forKey: "enableTags") }, set: { newValue in - self.tags = newValue UserDefaults.standard.set(newValue, forKey: "enableTags") } )) Toggle("Display nekos.moe Tags", isOn: Binding( - get: { self.moetags }, + get: { UserDefaults.standard.bool(forKey: "enableMoeTags") }, set: { newValue in - self.moetags = newValue UserDefaults.standard.set(newValue, forKey: "enableMoeTags") } )) Toggle("Kyoko 'Note' banner", isOn: Binding( - get: { self.kyokobanner }, + get: { UserDefaults.standard.bool(forKey: "enableKyokobanner") }, set: { newValue in - self.kyokobanner = newValue UserDefaults.standard.set(newValue, forKey: "enableKyokobanner") } )) diff --git a/AnimeGen/Settings/App Settings/Content.swift b/AnimeGen/Settings/App Settings/Content.swift index a6d5e1c1..8f9e75c8 100644 --- a/AnimeGen/Settings/App Settings/Content.swift +++ b/AnimeGen/Settings/App Settings/Content.swift @@ -21,13 +21,11 @@ struct Contents: View { """)) { Toggle("Explicit Contents", isOn: Binding( - get: { self.explicitCont }, + get: { UserDefaults.standard.bool(forKey: "enableExplictiCont") }, set: { newValue in + UserDefaults.standard.set(newValue, forKey: "enableExplictiCont") if newValue { - showAlert = true - } else { - self.explicitCont = newValue - UserDefaults.standard.set(newValue, forKey: "enableExplictiCont") + self.showAlert = true } } )) diff --git a/AnimeGen/Settings/App Settings/Developer.swift b/AnimeGen/Settings/App Settings/Developer.swift index bce4b658..3d158b85 100644 --- a/AnimeGen/Settings/App Settings/Developer.swift +++ b/AnimeGen/Settings/App Settings/Developer.swift @@ -23,17 +23,15 @@ struct DeveloperPref: View { """)) { Toggle("Developer Mode", isOn: Binding( - get: { self.developerMode }, + get: { UserDefaults.standard.bool(forKey: "enableDeveloperMode") }, set: { newValue in - self.developerMode = newValue UserDefaults.standard.set(newValue, forKey: "enableDeveloperMode") } )) Toggle("Developer Alert", isOn: Binding( - get: { self.developerAlert }, + get: { UserDefaults.standard.bool(forKey: "enableDeveloperAlert") }, set: { newValue in - self.developerAlert = newValue UserDefaults.standard.set(newValue, forKey: "enableDeveloperAlert") } )) diff --git a/AnimeGen/Settings/App Settings/History.swift b/AnimeGen/Settings/App Settings/History.swift index 72a29919..b408b746 100644 --- a/AnimeGen/Settings/App Settings/History.swift +++ b/AnimeGen/Settings/App Settings/History.swift @@ -17,7 +17,13 @@ struct HistoryPref: View { NavigationView { Form { Section(footer: Text("'Don't clear history': It makes so that the history will not be cleared when closing the app.")) { - Toggle("Don't clear history", isOn: $historyOvertime) + Toggle("Don't clear history", isOn: Binding( + get: { self.historyOvertime }, + set: { newValue in + self.historyOvertime = newValue + UserDefaults.standard.set(newValue, forKey: "enableHistoryOvertime") + } + )) } Section { diff --git a/AnimeGen/Settings/SettingsPage.swift b/AnimeGen/Settings/SettingsPage.swift index b0dea372..c46c9a64 100644 --- a/AnimeGen/Settings/SettingsPage.swift +++ b/AnimeGen/Settings/SettingsPage.swift @@ -18,42 +18,63 @@ struct SettingsPage: View { Section(header: Text("App Settings"), footer: Text("You can access different app settings on these pages.")) { NavigationLink(destination: APIPreferences()) { - Text("APIs Preferences") - .foregroundColor(.accentColor) + HStack { + Image(systemName: "gear") + Text("APIs Preferences") + .foregroundColor(.accentColor) + } } NavigationLink(destination: Features()) { - Text("App Features") - .foregroundColor(.accentColor) + HStack { + Image(systemName: "square.grid.2x2") + Text("App Features") + .foregroundColor(.accentColor) + } } NavigationLink(destination: Contents()) { - Text("Contents Settings") - .foregroundColor(.accentColor) + HStack { + Image(systemName: "doc.text.magnifyingglass") + Text("Contents Settings") + .foregroundColor(.accentColor) + } } NavigationLink(destination: HistoryPref()) { - Text("History Settings") - .foregroundColor(.accentColor) + HStack { + Image(systemName: "clock") + Text("History Settings") + .foregroundColor(.accentColor) + } } NavigationLink(destination: DeveloperPref()) { - Text("Developer Preferences") - .foregroundColor(.accentColor) + HStack { + Image(systemName: "hammer") + Text("Developer Preferences") + .foregroundColor(.accentColor) + } } } Section(header: Text("About AnimeGen")) { NavigationLink(destination: AboutPage()) { - Text("About") - .foregroundColor(.accentColor) + HStack { + Image(systemName: "info.circle") + Text("About") + .foregroundColor(.accentColor) + } } NavigationLink(destination: ApiPage()) { - Text("APIs credits") - .foregroundColor(.accentColor) + HStack { + Image(systemName: "list.bullet") + Text("APIs Credits") + .foregroundColor(.accentColor) + } } if #available(iOS 14.0, *) {