SwiftUI - Is there a popViewController equivalent in SwiftUI?

后端 未结 13 2132
说谎
说谎 2020-12-12 20:18

I was playing around with SwiftUI and want to be able to come back to the previous view when tapping a button, the same we use popViewController inside a

13条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-12 21:01

    In the destination pass the view you want to redirect, and inside block pass data you to pass in another view.

    NavigationLink(destination: "Pass the particuter View") {
        Text("Push")
    }
    

提交回复
热议问题