diff --git a/NearFuture.xcodeproj/project.pbxproj b/NearFuture.xcodeproj/project.pbxproj index 28f3746..337df55 100644 --- a/NearFuture.xcodeproj/project.pbxproj +++ b/NearFuture.xcodeproj/project.pbxproj @@ -571,7 +571,7 @@ "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; + IPHONEOS_DEPLOYMENT_TARGET = 16; LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 13; @@ -622,7 +622,7 @@ "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; + IPHONEOS_DEPLOYMENT_TARGET = 16; LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 13; diff --git a/NearFuture/AddEventView.swift b/NearFuture/AddEventView.swift index d2aa17d..cff21ec 100644 --- a/NearFuture/AddEventView.swift +++ b/NearFuture/AddEventView.swift @@ -59,7 +59,11 @@ struct AddEventView: View { title: "Choose a Symbol", searchLabel: "Search...", autoDismiss: true) - .presentationBackground(.ultraThinMaterial) + .apply { + if #available(iOS 16.4, *) { + $0.presentationBackground(.ultraThinMaterial) + } + } } ColorPicker("", selection: $eventColor, supportsOpacity: false) .fixedSize() @@ -249,6 +253,10 @@ struct MagicClearButton: View { adding: true ) .presentationDragIndicator(.visible) - .presentationBackground(.ultraThinMaterial) + .apply { + if #available(iOS 16.4, *) { + $0.presentationBackground(.ultraThinMaterial) + } + } } } diff --git a/NearFuture/ArchiveView.swift b/NearFuture/ArchiveView.swift index ca062f9..e367fd7 100644 --- a/NearFuture/ArchiveView.swift +++ b/NearFuture/ArchiveView.swift @@ -59,7 +59,11 @@ struct ArchiveView: View { adding: true ) .presentationDragIndicator(.visible) - .presentationBackground(.ultraThinMaterial) + .apply { + if #available(iOS 16.4, *) { + $0.presentationBackground(.ultraThinMaterial) + } + } } } } diff --git a/NearFuture/Assets.xcassets/uiColors/Contents.json b/NearFuture/Assets.xcassets/uiColors/Contents.json new file mode 100644 index 0000000..6e96565 --- /dev/null +++ b/NearFuture/Assets.xcassets/uiColors/Contents.json @@ -0,0 +1,9 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "provides-namespace" : true + } +} diff --git a/NearFuture/Assets.xcassets/uiColors/basic.colorset/Contents.json b/NearFuture/Assets.xcassets/uiColors/basic.colorset/Contents.json new file mode 100644 index 0000000..648b3c7 --- /dev/null +++ b/NearFuture/Assets.xcassets/uiColors/basic.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.000", + "green" : "0.000", + "red" : "0.000" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/NearFuture/Assets.xcassets/uiColors/blue.colorset/Contents.json b/NearFuture/Assets.xcassets/uiColors/blue.colorset/Contents.json new file mode 100644 index 0000000..270bc6d --- /dev/null +++ b/NearFuture/Assets.xcassets/uiColors/blue.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.961", + "green" : "0.510", + "red" : "0.227" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/NearFuture/Assets.xcassets/uiColors/green.colorset/Contents.json b/NearFuture/Assets.xcassets/uiColors/green.colorset/Contents.json new file mode 100644 index 0000000..9c7fe7f --- /dev/null +++ b/NearFuture/Assets.xcassets/uiColors/green.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.216", + "green" : "0.737", + "red" : "0.337" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/NearFuture/Assets.xcassets/uiColors/indigo.colorset/Contents.json b/NearFuture/Assets.xcassets/uiColors/indigo.colorset/Contents.json new file mode 100644 index 0000000..4409318 --- /dev/null +++ b/NearFuture/Assets.xcassets/uiColors/indigo.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.871", + "green" : "0.329", + "red" : "0.345" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/NearFuture/Assets.xcassets/uiColors/orange.colorset/Contents.json b/NearFuture/Assets.xcassets/uiColors/orange.colorset/Contents.json new file mode 100644 index 0000000..aff6f36 --- /dev/null +++ b/NearFuture/Assets.xcassets/uiColors/orange.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "extended-srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.000", + "green" : "0.376", + "red" : "1.000" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/NearFuture/Assets.xcassets/uiColors/pink.colorset/Contents.json b/NearFuture/Assets.xcassets/uiColors/pink.colorset/Contents.json new file mode 100644 index 0000000..dea2e32 --- /dev/null +++ b/NearFuture/Assets.xcassets/uiColors/pink.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.349", + "green" : "0.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/NearFuture/Assets.xcassets/uiColors/red.colorset/Contents.json b/NearFuture/Assets.xcassets/uiColors/red.colorset/Contents.json new file mode 100644 index 0000000..b4e292f --- /dev/null +++ b/NearFuture/Assets.xcassets/uiColors/red.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.242", + "green" : "0.197", + "red" : "0.910" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/NearFuture/Assets.xcassets/uiColors/yellow.colorset/Contents.json b/NearFuture/Assets.xcassets/uiColors/yellow.colorset/Contents.json new file mode 100644 index 0000000..e825c1a --- /dev/null +++ b/NearFuture/Assets.xcassets/uiColors/yellow.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.239", + "green" : "0.690", + "red" : "0.933" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/NearFuture/ContentView.swift b/NearFuture/ContentView.swift index f8f92ba..6648d0f 100644 --- a/NearFuture/ContentView.swift +++ b/NearFuture/ContentView.swift @@ -118,7 +118,11 @@ struct ContentView: View { adding: true //adding event ) .presentationDragIndicator(.visible) - .presentationBackground(.ultraThinMaterial) + .apply { + if #available(iOS 16.4, *) { + $0.presentationBackground(.ultraThinMaterial) + } + } } .toolbar { ToolbarItem(placement: .topBarTrailing) { diff --git a/NearFuture/Item.swift b/NearFuture/Item.swift index e26a3af..3b7ca09 100644 --- a/NearFuture/Item.swift +++ b/NearFuture/Item.swift @@ -128,6 +128,16 @@ class SettingsViewModel: ObservableObject { } } } + + func saveSettings() { + let encoder = JSONEncoder() + if let encoded = try? encoder.encode(settings) { + appGroupSettingsStore.set(encoded, forKey: "settings") + icSettStore.set(encoded, forKey: "settings") + icSettStore.synchronize() + loadSettings() + } + } } class EventViewModel: ObservableObject { diff --git a/NearFuture/SettingsView.swift b/NearFuture/SettingsView.swift index 4acdf1c..8093215 100644 --- a/NearFuture/SettingsView.swift +++ b/NearFuture/SettingsView.swift @@ -39,15 +39,16 @@ struct SettingsView: View { return .red } } - let rainbow = [ - Color.red, - Color.orange, - Color.yellow, - Color.green, - Color.blue, - Color.indigo, - Color.purple + let rainbow: [Color] = [ + Color.UiColors.red, + Color.UiColors.orange, + Color.UiColors.yellow, + Color.UiColors.green, + Color.UiColors.blue, + Color.UiColors.indigo, + Color.UiColors.basic ] + @State private var selectedIndex: Int = 1 var body: some View { NavigationStack { @@ -56,12 +57,22 @@ struct SettingsView: View { List { ScrollView(.horizontal) { HStack { - ForEach(rainbow, id: \.self) { color in - Button() { - settingsModel.settings.tint.colorBind = color - } label: { - Circle() - .foregroundStyle(color) + ForEach(0.. String { + let bundle = Bundle.main + guard let icons = bundle.object(forInfoDictionaryKey: "CFBundleIcons") as? [String: Any], + let primaryIcon = icons["CFBundlePrimaryIcon"] as? [String: Any], + let iconFiles = primaryIcon["CFBundleIconFiles"] as? [String], + let iconFileName = iconFiles.last else { + fatalError("hell na where ur icon") + } + return iconFileName +} + +func getVersion() -> String { + guard let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] else { + fatalError("no bundle id wtf lol") + } + return "\(version)" +} + +func getBuildID() -> String { + guard let build = Bundle.main.infoDictionary?["CFBundleVersion"] else { + fatalError("wtf did u do w the build number") + } + return "\(build)" +}