0

So I'm building a project based on SwiftUI and on one of my struct Views I have a UIViewRepresentable that produces a UICollectionView. Also on this View, I have a @State variable called 'showNextSheet' that presents a new sheet when toggled.

I've implemented the UICollectionView successfully, but now I'm trying to present a new sheet when a user clicks on a cell in the UICollectionView. I have access to the 'didSelectItemAt' method, but I can't figure out how to pass the Binding variable (showNextSheet) into the cell. Is this possible?

nicksarno
  • 3,850
  • 1
  • 13
  • 33
  • Would you provide code? – Asperi Aug 26 '20 at 03:45
  • I didn't post any because it would be too complicated to navigate on here. I'm basically asking if there's anyway to pass a Binding variable (@State var showNextSheet = false) into a UICollectionViewCell. The issue is that the variable within the cell (needing to be @Binding var showNextSheet) must be set up on init. – nicksarno Aug 26 '20 at 14:15

0 Answers0