且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在需要注册的应用程序中管理视图控制器

更新时间:2023-11-22 16:04:28

在应用程序启动时,确定用户是否已经登录.

At the start of the app, determine whether or not the user is logged in already.

如果用户未登录:

  • 将rootViewController设置为UINavigationController并添加您的 欢迎查看. (如果希望导航栏看起来像您发布的照片​​,则可以将其隐藏.)
  • 当他们点击注册或登录按钮时, 将适当的视图控制器推到导航控制器上 堆栈.
  • 成功登录后,用UITabBarController 替换根视图控制器.
  • Set the rootViewController to a UINavigationController and add your Welcome view to it. (You can hide the navigation bar if you want it to look like the photo that you posted.)
  • When they tap the register or sign in buttons, push the appropriate view controller onto the navigation controller stack.
  • After a successful login, replace the root view controller with the UITabBarController.

如果用户已登录:

将rootViewController设置为UITabBarController.

Set the rootViewController to the UITabBarController.