Skip to content
0:00 / 0:00

#swiftdata#wwdc23#enums

WWDC23 SwiftData: how to use enums in SwiftData models

Zack Zack

440 subscribers • 1 video on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • May be out of date. The tools, versions or practices it shows have likely moved on.

Intermediate. Assumes working knowledge.

1.7K views3 years ago2 recommendations

Databases and dataMobile developmentSwiftiOS and SwiftUI

This video demonstrates a workaround for using enum types in SwiftData models during the early WWDC23 beta.

WWDC introduced SwiftData, a new way of persisting data, basically CoreData on steriod and in SwiftUI's cloths, but this early beta, enum types breaks the functionality, and i have a workaround for you.

Why it's here

2 people recommend this

What people say. Recommended as a helpful workaround for a common enum issue in early SwiftData betas.

u/overPaidEngineerin r/swift • Recommends

wwdc23 swiftdata's enum issue and how to get around it [video

u/terranisaurin r/swift • Recommends

On “wwdc23 swiftdata's enum issue and how to get around it”

>link to this video You're right! I had to add a raw type to the enums to get it to work, otherwise I got the same error you got in the video. Thanks for the post that would have been really annoying to find out later on.