Question : func that returns a view swiftui
Answered by : quaint-quail-rblyi6q3wthz
@ViewBuilder func getView(view: String) -> some View { switch view { case "CreateUser": Text(view) case "Abc": Image("Abc") default: EmptyView() }
}
Source : https://stackoverflow.com/questions/62895948/how-to-return-a-view-type-from-a-function-in-swift-ui | Last Update : Wed, 10 Feb 21