@bryan1anderson I don't think you can. If your dataset is large enough (like my example), you'll always get hangs. It looks to me like Query/Predicate is the issue here, they seem to run everything on the Swift side rather than being transformed into SQL queries that run directly on the underlying SQL database.
On the example that I posted and that @DTS Engineer confirmed, the SQL part runs really fast, but the overall fetch is slow.
I'd love for Apple to give this more attention, because if having a big dataset is a deal breaker, nobody -unless you're 100% sure your data will always be very small- should use Swift Data. Imagine if you build a very complex app using Swift Data and your dataset keeps growing, you'll hit a point where you need to re-write the model layer using Core Data, kinda insane if you ask me.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: