Introduction
In the last lesson, you added some additional, separate, queries that allowed you to start to filter views in the SwiftRecipes app. This filtering was vital since the amount of sample data in the project was already large, and would just get bigger when more data would get added by the user.
Those queries weren’t ideal however. There are more efficient ways to build queries on the database using predicates, both simple and complex. So in this lesson, you will:
- Learn about predicates for building queries in SwiftData
- Build predicates that are based on multiple properties
- Optimize fetches if you know you just need a limited set of data returned