Does SwiftData support UIImage as in CoreData specified here: https://www.swiftdevjournal.com/saving-images-in-core-data/ If it does, how to specify that in the @Model schema, especially using external storage to save the image in a separate file. Thanks.
Does SwiftData support UIImage
I converted my Core Data app to SwiftData and here is how the @Model turned out with respect to my image.
@Attribute(.externalStorage) var imageData: Data?
Thanks @SpaceMan!
Here's how I turned my data into a UIImage.
var myImage: UIImage? = nil
if let imageData = modelEntity.imageData {
myImage = UIImage(data: imageData)
}