Can’t pass data correctly to modal presentation using ForEach and CoreData in SwiftUI
问题 Im trying to pass data of some object from list of objects to modal sheet, fetching data from CoreData. The problem is that no matter what object I click on in the list, only the data form last added object appears in the details view. The same goes for deleting the object - no matter what object I'm trying to delete, the last one is deleted all the time. Problem disappears using NavigationLink, but it is not suitable for me. Here is my code: import SwiftUI struct CarScrollView: View {