diff --git a/NearFuture.xcodeproj/project.pbxproj b/NearFuture.xcodeproj/project.pbxproj index 76dcac0..bf5a837 100644 --- a/NearFuture.xcodeproj/project.pbxproj +++ b/NearFuture.xcodeproj/project.pbxproj @@ -376,6 +376,10 @@ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "-Xlinker", + "-interposable", + ); SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -464,6 +468,10 @@ "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 13; MARKETING_VERSION = 2.0; + OTHER_LDFLAGS = ( + "-Xlinker", + "-interposable", + ); PRODUCT_BUNDLE_IDENTIFIER = dev.neon443.NearFuture; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; @@ -506,6 +514,7 @@ "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 13; MARKETING_VERSION = 2.0; + OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = dev.neon443.NearFuture; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; @@ -538,6 +547,10 @@ "@executable_path/../../Frameworks", ); MARKETING_VERSION = 2.0; + OTHER_LDFLAGS = ( + "-Xlinker", + "-interposable", + ); PRODUCT_BUNDLE_IDENTIFIER = dev.neon443.NearFuture.NearFutureWidgets; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; diff --git a/NearFuture.xcodeproj/project.xcworkspace/xcuserdata/neon443.xcuserdatad/UserInterfaceState.xcuserstate b/NearFuture.xcodeproj/project.xcworkspace/xcuserdata/neon443.xcuserdatad/UserInterfaceState.xcuserstate index e6b339e..1c89524 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.xcodeproj/xcuserdata/neon443.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/NearFuture.xcodeproj/xcuserdata/neon443.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 6524533..c3006bd 100644 --- a/NearFuture.xcodeproj/xcuserdata/neon443.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/NearFuture.xcodeproj/xcuserdata/neon443.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -52,15 +52,6 @@ symbolName = "disable" moduleName = ""> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NearFuture/AddEventView.swift b/NearFuture/AddEventView.swift index 2e46443..adce4ba 100644 --- a/NearFuture/AddEventView.swift +++ b/NearFuture/AddEventView.swift @@ -66,6 +66,7 @@ struct AddEventView: View { .padding(.trailing, eventName.isEmpty ? 0 : 30) .animation(.spring, value: eventName) .focused($focusedField, equals: Field.Name) + .submitLabel(.next) .onSubmit { focusedField = .Description } @@ -80,6 +81,7 @@ struct AddEventView: View { .padding(.trailing, eventDescription.isEmpty ? 0 : 30) .animation(.spring, value: eventDescription) .focused($focusedField, equals: Field.Description) + .submitLabel(.done) .onSubmit { focusedField = nil } diff --git a/NearFuture/ContentView.swift b/NearFuture/ContentView.swift index ec873f8..cb1f97b 100644 --- a/NearFuture/ContentView.swift +++ b/NearFuture/ContentView.swift @@ -8,6 +8,10 @@ import SwiftUI import SwiftData +enum Field { + case Search +} + struct ContentView: View { @StateObject private var viewModel = EventViewModel() @State private var eventName = "" @@ -62,10 +66,15 @@ struct ContentView: View { } @State var showSettings: Bool = false - @FocusState private var focusedField: Field? - private enum Field { - case Search + var noEvents: Bool { + if viewModel.events.count == 0 { + return true + } else { + return false + } } + + @FocusState private var focusedField: Field? var body: some View { TabView { @@ -86,6 +95,7 @@ struct ContentView: View { .onSubmit { focusedField = nil } + .submitLabel(.done) MagicClearButton(text: $searchInput) } .padding(.horizontal) @@ -95,25 +105,10 @@ struct ContentView: View { } .onDelete(perform: viewModel.removeEvent) if !searchInput.isEmpty { - HStack { - Image(systemName: "questionmark.square.dashed") - .resizable() - .scaledToFit() - .frame(width: 30, height: 30) - .padding(.trailing) - Text("Can't find what you're looking for?") - } - Text("Tip: The Search bar searches event names and descriptions") - Button() { - searchInput = "" - focusedField = nil - } label: { - HStack { - Image(systemName: "xmark") - Text("Clear Filters") - } - .foregroundStyle(Color.accentColor) - } + SearchHelp( + searchInput: $searchInput, + focusedField: _focusedField + ) } } } @@ -210,6 +205,32 @@ struct EventListView: View { } } +struct SearchHelp: View { + @Binding var searchInput: String + @FocusState var focusedField: Field? + var body: some View { + HStack { + Image(systemName: "questionmark.square.dashed") + .resizable() + .scaledToFit() + .frame(width: 30, height: 30) + .padding(.trailing) + Text("Can't find what you're looking for?") + } + Text("Tip: The Search bar searches event names and descriptions") + Button() { + searchInput = "" + focusedField = nil + } label: { + HStack { + Image(systemName: "xmark") + Text("Clear Filters") + } + .foregroundStyle(Color.accentColor) + } + } +} + #Preview { ContentView() }