WWDC WEEK
SALE
30
%
off
Subscribe now
WWDC WEEK
SALE
30
%
off
Subscribe now

Why you can't use enums in SwiftData

Episode Clip • Jun 5, 2025

SwiftData is not capable of filtering and sorting by raw representable enum properties in models. Predicates and sort descriptors will compile just fine when referencing enum properties, but it will crash at runtime.

This is an excerpt from our episode exploring modern persistence techniques in applications.

Get started with our free plan

Our free plan includes 1 subscriber-only episode of your choice, access to 72 free episodes with transcripts and code samples, and weekly updates from our newsletter.

View plans and pricing