0Pricing
SwiftUI Academy · Lesson

Predicates & Sort Descriptors

Filter and order fetched results.

Shaping Your Results

As data grows you rarely want every row. Predicates and sort descriptors let you fetch just the right slice.

What a Predicate Is

An NSPredicate is a rule that decides which records match, written in a compact query-like format string.

NSPredicate(format: "isDone == true")

All lessons in this course

  1. The Core Data Stack
  2. Fetching with @FetchRequest
  3. Creating & Saving Entities
  4. Predicates & Sort Descriptors
← Back to SwiftUI Academy