Same crash happened in my project when using enum types in my Swift Data model along with the Swift Data history APIs. I found a less ideal solution to the problem was to use a @Transient property exposing my enum and have the underlying data backed by a more permeative type.
@Transient
var sessionType: TaskSessionType {
get { TaskSessionType(rawValue: sessionTypeRaw) ?? .focus }
set { sessionTypeRaw = newValue.rawValue }
}
private(set) var sessionTypeRaw: Int = TaskSessionType.focus.rawValue
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: