Post

Replies

Boosts

Views

Activity

Reply to dual predicate search using CoreData
I guess my original question was answered by @deeje - I'd accept that answer but NSCompoundPredicate was spelled wrong🤓 https://stackoverflow.com/questions/31708540/swift-combining-predicates is useful reading on the topic. My follow-on question of how exactly to do that is mostly answered by "the data you compare must have the same type". My desire to add this functionality is now lower than my desire to figure out how to get SwiftUI to do this in the spot I need it. The basic Int(dateVariable) was met with some compiler error I didn't dig into.
Topic: App & System Services SubTopic: iCloud Tags:
Mar ’25
Reply to dual predicate search using CoreData
Thanks for the quick answer! Is "dateFromText" some sort of function somewhere? The compiler says it's out of scope and I don't find it in searches. I don't want to type the entire date in the search so the == seems not in the direction I want to go. I likely need to read more up on predicates before I'm ready to create this feature. I was thinking that I could type any character or word in my list and it would find that. Like if any of the dates were 2022 - I could type 22 and it would find that. It seems like I'd have to convert the date back to text to do that. Then there's the problematic issue with date formatting where a search of 22 might find the 22nd of a month in addition to the year and then there's numeric months vs. spelled out in long format...
Topic: App & System Services SubTopic: iCloud Tags:
Mar ’25
Reply to dual predicate search using CoreData
Thanks for the quick answer! But my question evolved since I wrote this: While the predicate I created (quoted above) for searching a String works great. My other attribute is a Date, but when I try to search on the date field nothing works: .searchable(text: $searchText) .onChange(of: searchText) { _, text in evnts.nsPredicate = text.isEmpty ? nil : NSPredicate(format: "eventDate CONTAINS %i " , text ) also %@ doesn't work either I did read up on CompoundPredicates here: https://stackoverflow.com/questions/31708540/swift-combining-predicates But since one of my predicates doesn't work on it's own, I don't see how combining them will magically work.
Topic: App & System Services SubTopic: iCloud Tags:
Mar ’25
Reply to How to Change Picker Text Color In SwiftUI
I can see that both .tint & .accentColor works for the default picker. But is there any way to change the color of a .pickerStyle(.wheel)? I've tried a lot of scenarios. It only seems to work with .automatic. Picker ("", selection: $countDowns) { ForEach(countDowns, id: \.self) { countDown in Text(" \(countDown)") // .accentColor(.blue) } } .accentColor(.blue) // .tint(.blue) // .pickerStyle(.wheel) .font(.largeTitle) .scaleEffect(2.0)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’24
Reply to landscape support
I asked about this in a WWDC24 lab. I didn't get any real recognition that this is a big accessibility problem. They did recommend NOT creating 2 layouts that shift completely when going from portrait to landscape as that would be very disorienting. SwiftUI by design is meant to flow naturally when shifting orientation. Essentially the answer was: work on constraining and spacing things to fit as best as you can. The impression I get is: If you have to lock your app to one orientation or the other that's probably fine. There are some very highly regarded apps that do that.
Topic: Design SubTopic: General Tags:
Jun ’24
Reply to I can't log-in to the forums from the forums page!
I just went round and round trying to log in where it would tell me to create an account and when I tried type the user name that I know had worked it said that user name was taken. Then I realized the screen it's popping up is always defaulting to another apple ID - not my dev account one. So you have to click on the little "Log in with another Apple ID". That got me logged in. Maybe this will help you?
Jun ’24
Reply to dual predicate search using CoreData
I guess my original question was answered by @deeje - I'd accept that answer but NSCompoundPredicate was spelled wrong🤓 https://stackoverflow.com/questions/31708540/swift-combining-predicates is useful reading on the topic. My follow-on question of how exactly to do that is mostly answered by "the data you compare must have the same type". My desire to add this functionality is now lower than my desire to figure out how to get SwiftUI to do this in the spot I need it. The basic Int(dateVariable) was met with some compiler error I didn't dig into.
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to dual predicate search using CoreData
Thanks for the quick answer! Is "dateFromText" some sort of function somewhere? The compiler says it's out of scope and I don't find it in searches. I don't want to type the entire date in the search so the == seems not in the direction I want to go. I likely need to read more up on predicates before I'm ready to create this feature. I was thinking that I could type any character or word in my list and it would find that. Like if any of the dates were 2022 - I could type 22 and it would find that. It seems like I'd have to convert the date back to text to do that. Then there's the problematic issue with date formatting where a search of 22 might find the 22nd of a month in addition to the year and then there's numeric months vs. spelled out in long format...
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to dual predicate search using CoreData
Thanks for the quick answer! But my question evolved since I wrote this: While the predicate I created (quoted above) for searching a String works great. My other attribute is a Date, but when I try to search on the date field nothing works: .searchable(text: $searchText) .onChange(of: searchText) { _, text in evnts.nsPredicate = text.isEmpty ? nil : NSPredicate(format: "eventDate CONTAINS %i " , text ) also %@ doesn't work either I did read up on CompoundPredicates here: https://stackoverflow.com/questions/31708540/swift-combining-predicates But since one of my predicates doesn't work on it's own, I don't see how combining them will magically work.
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to How to Change Picker Text Color In SwiftUI
I can see that both .tint & .accentColor works for the default picker. But is there any way to change the color of a .pickerStyle(.wheel)? I've tried a lot of scenarios. It only seems to work with .automatic. Picker ("", selection: $countDowns) { ForEach(countDowns, id: \.self) { countDown in Text(" \(countDown)") // .accentColor(.blue) } } .accentColor(.blue) // .tint(.blue) // .pickerStyle(.wheel) .font(.largeTitle) .scaleEffect(2.0)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to landscape support
I asked about this in a WWDC24 lab. I didn't get any real recognition that this is a big accessibility problem. They did recommend NOT creating 2 layouts that shift completely when going from portrait to landscape as that would be very disorienting. SwiftUI by design is meant to flow naturally when shifting orientation. Essentially the answer was: work on constraining and spacing things to fit as best as you can. The impression I get is: If you have to lock your app to one orientation or the other that's probably fine. There are some very highly regarded apps that do that.
Topic: Design SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to I can't log-in to the forums from the forums page!
I just went round and round trying to log in where it would tell me to create an account and when I tried type the user name that I know had worked it said that user name was taken. Then I realized the screen it's popping up is always defaulting to another apple ID - not my dev account one. So you have to click on the little "Log in with another Apple ID". That got me logged in. Maybe this will help you?
Replies
Boosts
Views
Activity
Jun ’24