Post

Replies

Boosts

Views

Activity

Reply to SwiftData History Tombstone Data is Unusable
I have managed to get out the dictionary using reflection, guess this will do as a temporary workaround, but kind of strange that the api does not match the WWDC video or documentation. For people running into the same thing, this works until the API is actually there (just do not use this in production): extension History.Tombstone { subscript<T>(keyPath: KeyPath<Model, T>) -> T { let mirror = Mirror(reflecting: self) guard let storageChild = mirror.children.first(where: { $0.label == "storage" }), let dictionary = storageChild.value as? [PartialKeyPath<Model> : Any], let value = dictionary[keyPath] as? T else { fatalError("Missing expected tombstone value for \(keyPath)") } return value } }
Jun ’24
Reply to Error saving @Model with enum
This is mentioned in the release notes of iOS 17: https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-17-release-notes Case value is not stored properly for a string rawvalue enumeration. (108634193) Workaround: Don’t use a rawvalue with a string enum property.
Jun ’23
Reply to SwiftData History Tombstone Data is Unusable
I have managed to get out the dictionary using reflection, guess this will do as a temporary workaround, but kind of strange that the api does not match the WWDC video or documentation. For people running into the same thing, this works until the API is actually there (just do not use this in production): extension History.Tombstone { subscript<T>(keyPath: KeyPath<Model, T>) -> T { let mirror = Mirror(reflecting: self) guard let storageChild = mirror.children.first(where: { $0.label == "storage" }), let dictionary = storageChild.value as? [PartialKeyPath<Model> : Any], let value = dictionary[keyPath] as? T else { fatalError("Missing expected tombstone value for \(keyPath)") } return value } }
Replies
Boosts
Views
Activity
Jun ’24
Reply to Disable automatic iCloud sync with SwiftData
How is it possible that something as simple as turning off automatic syncing, which is part of the API, is not working in the RC version of Xcode 15, come on Apple...
Replies
Boosts
Views
Activity
Sep ’23
Reply to Error saving @Model with enum
This is mentioned in the release notes of iOS 17: https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-17-release-notes Case value is not stored properly for a string rawvalue enumeration. (108634193) Workaround: Don’t use a rawvalue with a string enum property.
Replies
Boosts
Views
Activity
Jun ’23