SwiftData Predicates on Enums

SwiftData has always supported enums — but filtering on them was a chore. Raw values, mapping, manual conversions. Not anymore.

iOS 27 changes everything.

What's covered:

  • SwiftData enum predicates — direct, no workarounds
  • Filtering with #Predicate { $0.expenseType == expenseType }
  • Building segmented filters in SwiftUI
  • Query initialization techniques with enums
  • Clean, type-safe code without raw values

Real example: An expense tracker that filters by ExpenseType enum (food, travel, housing, entertainment) — no raw values, no mapping, just Swift.

In partnership with
Fastlane alternative – CLI tools

Are you tired of Ruby and Fastlane installation issues? There's got to be a better way! Discover Codemagic open source CLI tools. It is not a drop-in replacement for all of what Fastlane does (screenshots for example), but we use it at Codemagic to build and publish iOS and Android apps, also versioning and device provisioning.

View on GitHub
© 2026 Mobile Signal. All rights reserved.
Made by
Stan
linkedin