I have a very simple CoreData model that has 1 entity and 2 attributes.
This code works fine:
.onChange(of: searchText) { _, text in
evnts.nsPredicate = text.isEmpty ? nil :NSPredicate(format: "eventName CONTAINS %@ " , text )
but I'd like to also search with the same text string for my second attribute (which is a Date). I believe an OR is appropriate for two conditions (find either one). See attempted code below:
evnts.nsPredicate = text.isEmpty ? nil : NSPredicate(format: "(eventName CONTAINS %@) OR (dueDate CONTAINS %i) " , text )
This crashes immediately %@ does the same. Is there a way to accomplish this?
How is SwiftUI not an option below?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Is there a way to add the day of the week to the wheel picker that pops up inside the Default calendar picker? How about an optional way to type a date in instead of lots of scrolling?
DatePicker("Enter a date", selection: $date1, displayedComponents: .date)
.datePickerStyle(DefaultDatePickerStyle())
This works OK, but it seems slow when entering a date to need to scroll and then tap the calendar again to fix the day of the week. Maybe a custom entering screen is the best path? It's frustrating that SwiftUI doesn't offer more options.
I see that Contacts goes right to the Wheel style, but Calendar uses this pop up calendar (Default) style) Maybe someone thinks that 3 scroll wheels are too much?
Topic:
UI Frameworks
SubTopic:
SwiftUI
I heard someone say recently that not supporting landscape on iPhone could be an accessibility problem for some folks. Right now I've got an SwiftUI app were lots of things break when I go to landscape mode. Is there a good resource to learn how to animate layouts around to support landscape when there's no way it will fit with the default twist?