Post

Replies

Boosts

Views

Activity

Comment on Does SwiftData support UIImage
Has the issue resolved? I convert a UIimage to data by the following codes, and save it to swiftData. But I get nil when I read it. Why? //save photo with swiftData let cameraPhotoID = UUID().uuidString let image = camera.photo.image! let data = image.pngData() let CameraPhoto = cameraPhoto(cameraPhotoID: cameraPhotoID,cameraPhotoData: data!) modelContext.insert(CameraPhoto) try? modelContext.save()
Nov ’23
Comment on Textfield bug after upgrading to IOS 17.0
Yes, it's SwiftUI app. After trying several times, I found the bug is related with @EnvironmentObject var. If I change $userViewModel.focusTime(which is an EnvironmentObject var) to focusTime(which is a @State var), the view works well. There is no any issue. But when I change the variable back to the @EnvironmentObject var, the same bug appears. But the data type is the same between both of them.
Nov ’23