I am trying to implement VIPER using SwiftUI. Firstly, I was returning a UIKit VC(UIHostingController(rootView)
) from the Wireframe until I realized that in navigation, when presenter tells Wireframe to present a SwiftUI View
, I can not pass a UIViewController
trough a NavigationLink
.
Having this issue, I tried to make Wireframe protocol to return a SwiftUI View
, but it seems to be no possible
Protocol 'View' can only be used as a generic constraint because it has
Self
or associated type requirements
final class HomeWireFrame: HomeWireFrameProtocol {
//Error here returning a View
class func createHomeModule() -> View {
var view = HomeView()
//set up VIPER modules...
.
.
return view
How can a I define a function that will return a SwiftUI View
?