Posts

Post not yet marked as solved
3 Replies
6.5k Views
I used to be able to "right click" on the play button for a preview, but in Beta 1 and 2 of Xcode 13 that isn't working (neither is control clicking). Any ideas how to debug a preview short of running app in the simulator?
Posted Last updated
.
Post not yet marked as solved
9 Replies
6.7k Views
I have a list (sourced from Core Data) where each row is tappable and it opens a sheet. I’m passing an Observable Object from the list to the view loaded within the Sheet/Modal. I struggled with this code when I wrote it during the early/buggy days of SwiftUI last June (2019) and eventually ended up storing an ID in the row's View, then doing a lookup at time of tap. This worked great in iOS13 (and continues to do so even in Xcode 12) and resolved issues I had been experiencing with sheets opening the first time but never again (or not being dismissible). With that said, this doesn't sound like the right way to go, partially confirmed by this not working in iOS 14. I can't seem to find a good example anywhere of how one is supposed to do this. List { ForEach (locationStore.locations) { location in LocationRow(location: location, showLocationDetailsModal: self.$showLocationDetailsModal, locationIDToShowDetails: self.$locationIDToShowDetails)                         }                     }         .sheet(isPresented: self.$showLocationDetailsModal, content: { LocationDetailView(location: self.locationStore.locations.first(where: {$0.id == self.locationIDToShowDetails})!) .environmentObject(self.locationStore) .environmentObject(self.applicationManager)      })
Posted Last updated
.
Post not yet marked as solved
0 Replies
764 Views
I'm using an EnvironmentObject to store some data and have put a breakpoint on it in a swiftUI view. I'm trying to figure out what the value is for locationAccessRequested (see screenshot). I'm clearly making a very dumb mistake as I am unable to view the value. What am I doing wrong?
Posted Last updated
.