I am new to iOS programming and I couldn't find how can I launcher another ViewController using SwiftUI.
I have some code like:
NavigationView{
Button(action: {
self.doPing()
}) {
Text("Login !")
.foregroundColor(Color.white)
.padding([.top,.bottom], 20)
.padding([.leading,.trailing],40)
}
.background(Color.red)
.background(RoundedRectangle(cornerRadius: 50 , style: .circular))
.cornerRadius(30)
Spacer()
}
The doPing function is a network call which get the results back with onDelegate:
func ResponseHttp(result: String, type: String) {
if(type == "ping"){
doLogin(result: result)
}
else{
let ch = ResponseHandler(xml: result)
print(ch.getResponseData())
//launcher another screen on success
}
}
How can I launcher another screen there ? Without letting the user to go back. There is any tutorial which goes in deep with these ?
Thank you !