我已经完成了LogIn Page和Sign up Page工作正常,但它没有将用户重定向到LogIn Page。首先,用户需要登录才能重定向到配置文件页面,如果用户的电子邮件或密码错误,应用程序将不允许用户继续操作,我还需要有关注销用户的帮助。
检查我的导航流程here 请帮忙
我使用Swift
laters版本编码
答案 0 :(得分:0)
让我们从您的后端服务器获取,有一种方法可以检查某人当前是否已登录。它返回true或false。
现在,在您的移动应用中,您可以在appDelegate的didFinishLaunchingWithOptions
中调用该方法来检查您是否有用户
var currentUser = User()
//let's say that User class is where you established connection to your server.
if currentUser.isThereAnyUserLoggedIn(){
// since this statement is true; then just show them your tabBar
// give the tabBar an ID then initiate it from the storyboard
} else {
// which means there is no one
// then show the loginViewController
}
现在退出方法
if currentUser.hasPressedLogoutButton() {
// show the loginViewController
}