Conclusion
Applications that are backed by persistence mechanisms like SwiftData can hold a lot of data. Providing users with the ability to filter on the available data is a must for positive user experience. Building powerful predicates allows you to restrict the data shown to the user, providing only what is most important to them. You can even get more precise by only fetching a fixed set of values, which can come in handy for working with widgets and other views outside your main app.
In the next lesson, you’ll learn how to make sure your app continues to work as you evolve your data schema via successful data migrations.