1

I have wrapped a custom UIView inside a SwiftUI View and the Preview struct is giving me problems:

struct ContentView: UIViewRepresentable {
    @Binding var text: String
    ....
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some UIViewRepresentable {
        ContentView() // This is the offending line. It wants to change it to:
                      // ContentView(text: <#Binding<String>#>)
    }
}

What can I do to get this to work right? Why is it asking for a text argument?

Thanks!

Lester
  • 357
  • 3
  • 16

0 Answers0