Post

Replies

Boosts

Views

Activity

Reply to Importing Data into SwiftData in the Background Using ModelActor and @Query
SwiftData still have serious issues, specially when working with CloudKit (iOS 18 Beta). One of the issues I was able to identified is that the views do not update when relationships change. You can see all the values in an object except the values in the relationships (they are nil), but if I force an update on the view, the values show up. I hope they come up with a solution before release, otherwise SwiftData will be completely useless.
Aug ’24
Reply to can't use @Environment for Binding?
The most elegant solution I've found is to extract the view and pass the model to a @Bindable property. @Observable final class View1Model { var text: String = "" } struct View1: View { @State var viewModel = View1Model() var body: some View { View2() .environment(viewModel) } } struct View2: View { @Environment(View1Model.self) var viewModel var body: some View { View3(viewModel: viewModel) } } struct View3: View { @Bindable var viewModel: ViewModel var body: some View { TextField("Text", text: $viewModel.text) } }
Jun ’23
Reply to Couple questions about NavigationSplitView in SwiftUI
The NavigationSplitView works with List selection, and the NavigationLink must include the label and a value. The new process is explained here https://developer.apple.com/videos/play/wwdc2022/10054/ Although it works, there is an issue with the view at the moment. If you use an if else or a switch to select the view to show in Detail, it doesn't work. The solution for now is to embed it in a ZStack, as explained in this post https://developer.apple.com/forums/thread/707924
Jul ’22
Reply to Scrolling Issue in macOS Monterey (21A5522h) M1 Macbook Pro
I have the same issue with my Mac Mini M1. It stops scrolling on browsers and it starts jumping around on other applications. I filed a bug report. I hope they fix it for the final release because it makes the Magic Trackpad useless. Here is a quick video I made to show the problem. At first, it seems to work but then stops scrolling and fails two or three more times. It keeps failing every three or four attempts or every four or five seconds. I tried everything, but nothing solves the issue. It looks like a bug in Monterrey. https://www.youtube.com/watch?v=OxhW7biM5m0
Sep ’21