what does it take to pass swiftui view function parameters?

You can do what the error says, and use ContentViewProtocol as a generic constraint. Make showContent generic:

func showContent<V: ContentViewProtocol>(view: V)
    let child = UIHostingController(rootView: view)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top