Introduction

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

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
See forum comments
Download course materials from Github
Previous: Conclusion Next: Performing Efficient Queries