隐藏 UIViewController(或覆盖它)并与用户谈论“登录/注册”的屏幕的最佳做法是什么?
我想隐藏 Profile VC,因为必须先对用户进行身份验证。
最佳答案
这是你应该做的:
1:创建 2 个 View Controller (配置文件和登录/注册)
2: 在应用委托(delegate) didFinishLaunchingWithOptions
中查看用户是否
登录,如果不是点(在我的例子中我声明了 initialVC)他登录/注册这样的屏幕
也许:
if currentUser != nil{
self.window?.rootViewController = self.storyboard?.instantiateViewController(withIdentifier: "ProfileViewController")
}else{
self.window?.rootViewController = self.storyboard?.instantiateViewController(withIdentifier: "Login/RegisterViewController")
}
关于ios - 覆盖 'Must Sign-in screen'的最佳实践,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40105229/