Post

Replies

Boosts

Views

Activity

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
Topic: Community SubTopic: Apple Developers Tags:
Sep ’21
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
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’22
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) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’23
Reply to @Observable crashes in Xcode, iOS Beta 7 on iPad
I checked and get the same error. The only issue I found with your code is that you declared the property with @State but you should have declared it with @Bindable. But I tried and keep getting the error. It has to be a bug. The only solution was to manage the selection from a @State property (@State private var envProfile: String?)
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’23
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 @MainActor replace DispatchQueue.main?
I got it. It is answered in the Swift Concurrency, Behind the scenes talk. Thanks
Replies
Boosts
Views
Activity
Jun ’21
Reply to Where is the option Optimize Mac Storage for iCloud Drive?
I got it. The option is in the Apple ID panel now. Thanks
Replies
Boosts
Views
Activity
Jun ’21
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
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to Unable to enter text in TextField - SwiftUI preview
I have the same problem in Xcode 13.2. The only solution was to uninstall the 13.2 version and install the 13.1 version again. Very annoying.
Replies
Boosts
Views
Activity
Dec ’21
Reply to Xcode bug in SwiftUI previews when using Core Data
Do you know a better way to create the persistent store for the previews? I tried other approaches but the previews always crashes.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Xcode bug in SwiftUI previews when using Core Data
I solved all the issues by replacing the NSSortDescriptor class by the SortDescriptor structure.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
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
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to [PhotosPicker Bug iOS 16.0 beta 2] only deselect doesn't change PhotosPickerItem
I've found the same issue. Deselection still doesn't work in Beta 4. I'm worry.
Replies
Boosts
Views
Activity
Aug ’22
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) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to xcode 15 b3, apple internal ?
Not sure if it is related, but none of the examples about SwiftData work anymore in Beta 3. They are all broken. I'm getting the error "unsafeMutableAddressor of self" all the time. Maybe it was released ahead of schedule?
Replies
Boosts
Views
Activity
Jul ’23
Reply to SwiftData #Predicate case insensitive String comparison
Same problem. I couldn't find any solution. The macro uses PredicateExpressions enumerations to build the predicate. The enumeration includes a lot of methods but none seems to work for case insensitive searches. I hope they fix this soon or SwiftData becomes completely useless for most cases.
Replies
Boosts
Views
Activity
Jul ’23
Reply to Previews are not building for the SwiftDataCardSample project.
It is a bug. In Beta 3 it was possible to embed the preview code in MainActor.assumeIsolated { }, but this patch no longer works in Beta 4. They are now recommending to run the SwiftData apps in the simulator or a device until they fix the bug.
Replies
Boosts
Views
Activity
Jul ’23
Reply to Xcode 15 Beta 7 1. In expansion of macro '_PersistedProperty' here
In Beta 7, all the properties need a default value or be optional. @Model public class Product { public var id:UUID = UUID() public var name: String = "" //relationship public var category:Category? public init(name: String){ self.name = name }
Replies
Boosts
Views
Activity
Aug ’23
Reply to @Observable crashes in Xcode, iOS Beta 7 on iPad
I checked and get the same error. The only issue I found with your code is that you declared the property with @State but you should have declared it with @Bindable. But I tried and keep getting the error. It has to be a bug. The only solution was to manage the selection from a @State property (@State private var envProfile: String?)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23
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.
Replies
Boosts
Views
Activity
Aug ’24