1

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 !

maxh
  • 79
  • 4
  • I found this in another post, hopefully this is helpful. [Link](https://stackoverflow.com/questions/56437335/go-to-a-new-view-using-swiftui). – Scott Jul 01 '20 at 14:11

0 Answers0