How to present a view full-screen in SwiftUI?

前端 未结 4 2064
长情又很酷
长情又很酷 2021-01-02 05:33

I worked to a login view, now I want to present the view after login, but I do not want the user to have the possibility to return to the login

4条回答
  •  轮回少年
    2021-01-02 06:18

    struct ContentView: View {
        @EnvironmentObject var userAuth: UserAuth 
        var body: some View {
            if !userAuth.isLoggedin {
                return AnyView(LoginView())
            } else {
                return AnyView(HomeView())
            }
        }
    }
    

提交回复
热议问题