This is the Base View
struct BaseView<Content: View>: View {
@State private var ShowSFView : Bool = false
let content: Content
init(@ViewBuilder content: () -> Content ) {
self.content = content()
}
//Code for button and URL
}
I need to pass two String values to this BaseView , from another View when I call this baseView. One is for button label and other one for URL.
I'am unable to do it from declaring variables on initialiser, getting various errors. How can a i achieve this?
Edit
Initialiser in baseView
init(@ViewBuilder content: () -> Content , btnlabel: String) {
self.content = content()
self.btnlabel=btnlabel
}
How I called it from another View
BaseView.init(content: () -> _, btnlabel: "")