dragDetector returns a GeometryReader which is a View
You can look at the documentation for GeometryReader and Color.clear, both of them conform to View.
I think it will be best to start simple by going through the basics of SwiftUI. There is great documentation / videos on Apple Developer website.
Trying to learn SwiftUI by reading through code might not be the best approach, without the proper understanding of the basics of SwiftUI
Post
Replies
Boosts
Views
Activity
Passing a binding in a focusedSceneValue seems to work only when the app uses a WindowGroup.
When the app uses a Window (single window) passing the binding in focusedSceneValue doesn't seem to work.
When app uses Window focusedValue seems to work.
Is this expected behaviour?
Try to replace TrainingAttendanceView with a simple view (example: Color.red) and see what happens.
If the sheet opens then the problem could be with TrainingAttendanceView, begin commenting out code till you isolate the problem.
If the sheet doesn't open with a simple view then the problem could be in the parent view presenting it.
After isolating the problem create a project with minimum code to reproduce the issue and then post it in the forum so that others can have a look.
CoreData
Use @FetchRequest to keep CoreData in sync with SwiftUI view
https://developer.apple.com/wwdc21/10017?time=581
SwiftData
Use Query, to keep SwiftData in sync with your SwiftUI view.
Please watch the WWDC videos on SwiftData to see how it is meant to be used with SwiftUI views.
Reference:
https://developer.apple.com/wwdc23/10154?time=330
https://developer.apple.com/documentation/swiftdata/query
https://www.hackingwithswift.com/quick-start/swiftdata/how-to-use-query-to-read-swiftdata-objects-from-swiftui
After updating to macOS 15 Beta 6, I am able to open Xcode 15 Beta 5 and it doesn't crash.
You could it try after updating the OS to macOS 15 Beta 6.
For me Xcode 16 beta 5 crashes when I open it on macOS 15 beta 5
Xcode: Xcode 16 beta 5
macOS: macOS 15 beta 5
Thanks for filing the feedback, I hope this gets fixed as Xcode is unusable.
Just tested this on macOS 15 and seems to work fine. I am able to drag single / multiple items from a list and drop it on to a different list cell.
Note: I have not tested on
Could you post the minimum code so that I can try to understand what the issue is.
I am facing a similar issue with contacts permission on iOS 17 and iOS 16.4
@Developer Tools Engineer @eskimo FB13635680
@sasro I am stuck with the exact same problem.
Did you manage to solve this issue? If so how?
Based on my testing if you define inverse relationship then nil comparison works on Xcode Version 15.0 (15A240d)
Yes I am also facing the same issue, problem is there seems to be no way to compare enum, comparing enum always fails and comparing using rawValue crashes. Could you file a feedback, hopefully it gets fixed. https://developer.apple.com/documentation/swiftdata/preservingyourappsmodeldataacrosslaunches# claims that enum is supported however I am not sure how to get it to work.
I forgot to add the code for App, any help on this would be much appreciated.
SwiftDataEnumDemoApp
import SwiftUI
import SwiftData
@main
struct SwiftDataEnumDemoApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.modelContainer(for: Car.self)
}
}
}
@alexanderwe Has anyone tried using enum inside the Query predicate? For me enum gets saved however doesn't work with Query Refer https://developer.apple.com/forums/thread/737929
Can you provide a minimum reproducible code so that others can help
Can you try quitting Xcode, clearing DerivedData and trying again?