diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/NearFuture.xcodeproj/project.pbxproj b/NearFuture.xcodeproj/project.pbxproj index 7508ead..76dcac0 100644 --- a/NearFuture.xcodeproj/project.pbxproj +++ b/NearFuture.xcodeproj/project.pbxproj @@ -459,7 +459,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 = 15; + IPHONEOS_DEPLOYMENT_TARGET = 16; LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 13; @@ -501,7 +501,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 = 15; + 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.xcodeproj/project.xcworkspace/xcuserdata/neon443.xcuserdatad/UserInterfaceState.xcuserstate b/NearFuture.xcodeproj/project.xcworkspace/xcuserdata/neon443.xcuserdatad/UserInterfaceState.xcuserstate index c03860e..188705f 100644 Binary files a/NearFuture.xcodeproj/project.xcworkspace/xcuserdata/neon443.xcuserdatad/UserInterfaceState.xcuserstate and b/NearFuture.xcodeproj/project.xcworkspace/xcuserdata/neon443.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/NearFuture/AddEventView.swift b/NearFuture/AddEventView.swift index 8bae115..2e46443 100644 --- a/NearFuture/AddEventView.swift +++ b/NearFuture/AddEventView.swift @@ -29,7 +29,7 @@ struct AddEventView: View { @Environment(\.dismiss) var dismiss var body: some View { - NavigationView { + NavigationStack { Form { Section( header: @@ -88,12 +88,8 @@ struct AddEventView: View { // date picker - HStack { - Spacer() - DatePicker("", selection: $eventDate, displayedComponents: .date) - .datePickerStyle(WheelDatePickerStyle()) - Spacer() - } + DatePicker("", selection: $eventDate, displayedComponents: .date) + .datePickerStyle(WheelDatePickerStyle()) // re-ocurrence Picker Picker("Recurrence", selection: $eventRecurrence) { @@ -127,6 +123,9 @@ struct AddEventView: View { .font(.headline) .cornerRadius(10) .buttonStyle(BorderedProminentButtonStyle()) + if eventName.isEmpty { + Text("Give your event a name.") + } } .disabled(eventName.isEmpty) if eventName.isEmpty { diff --git a/NearFuture/ContentView.swift b/NearFuture/ContentView.swift index 3060e01..ec873f8 100644 --- a/NearFuture/ContentView.swift +++ b/NearFuture/ContentView.swift @@ -69,7 +69,7 @@ struct ContentView: View { var body: some View { TabView { - NavigationView { + NavigationStack { ZStack { backgroundGradient .ignoresSafeArea(.all) @@ -131,12 +131,6 @@ struct ContentView: View { adding: true //adding event ) } - .sheet( - isPresented: $showSettings) { - SettingsView( - viewModel: viewModel - ) - } .toolbar { ToolbarItem(placement: .topBarTrailing) { Button() { @@ -147,13 +141,6 @@ struct ContentView: View { .scaledToFit() } } - ToolbarItem(placement: .topBarLeading) { - Button() { - showSettings.toggle() - } label: { - Image(systemName: "gear") - } - } } } } @@ -164,6 +151,10 @@ struct ContentView: View { .tabItem { Label("Statistics", systemImage: "chart.pie") } + SettingsView(viewModel: viewModel) + .tabItem { + Label("Settings", systemImage: "gear") + } } } } diff --git a/NearFuture/EditEventView.swift b/NearFuture/EditEventView.swift index b89db96..6c7c882 100644 --- a/NearFuture/EditEventView.swift +++ b/NearFuture/EditEventView.swift @@ -31,7 +31,7 @@ struct EditEventView: View { } var body: some View { -// NavigationView { +// NavigationStack { AddEventView( viewModel: viewModel, eventName: $eventName, diff --git a/NearFuture/SettingsView.swift b/NearFuture/SettingsView.swift index 5d424a8..1923ce7 100644 --- a/NearFuture/SettingsView.swift +++ b/NearFuture/SettingsView.swift @@ -9,7 +9,6 @@ import SwiftUI struct SettingsView: View { @State var viewModel: EventViewModel - @Environment(\.dismiss) var dismiss @State private var hasUbiquitous: Bool = false @State private var lastSyncWasSuccessful: Bool = false @@ -41,7 +40,7 @@ struct SettingsView: View { } var body: some View { - NavigationView { + NavigationStack { List { NavigationLink() { iCloudSettingsView( @@ -69,7 +68,7 @@ struct SettingsView: View { } NavigationLink() { - NavigationView() { + NavigationStack() { Button() { UIPasteboard.general.string = "\(viewModel.exportEvents())" print(viewModel.exportEvents()) @@ -83,7 +82,7 @@ struct SettingsView: View { Text("Export events") } NavigationLink() { - NavigationView() { + NavigationStack() { VStack { TextEditor(text: $importStr) .foregroundStyle(.foreground, .gray) @@ -133,16 +132,6 @@ struct SettingsView: View { } .navigationTitle("Settings") .navigationBarTitleDisplayMode(.inline) - .toolbar { - ToolbarItem(placement: .topBarTrailing) { - Button() { - dismiss() - } label: { - Image(systemName: "xmark.circle.fill") - .symbolRenderingMode(.hierarchical) - } - } - } } } } diff --git a/NearFuture/StatsView.swift b/NearFuture/StatsView.swift index c511dac..07c735a 100644 --- a/NearFuture/StatsView.swift +++ b/NearFuture/StatsView.swift @@ -12,7 +12,7 @@ struct StatsView: View { @ObservedObject var viewModel: EventViewModel var body: some View { - NavigationView { + NavigationStack { List { Section(header: Text("Upcoming Events")) { let upcomingEvents = viewModel.events.filter { $0.date > Date() }