在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
var vc: UIViewController! let mainStoryboard = UIStoryboard(name: "Main", bundle: nil) //验证用户 var nsd = NSUserDefaults.standardUserDefaults() nsd.synchronize() let username = nsd.objectForKey("user") as? String let password = nsd.objectForKey("pwd") as? String /* 验证失败跳转回登录页 */ //1.如果不存在 if username == nil || password == nil { vc = mainStoryboard.instantiateViewControllerWithIdentifier("ViewController1") as UIViewController } else { //2.存在发送服务器 验证用户 失败跳转到登录页 vc = mainStoryboard.instantiateViewControllerWithIdentifier("ViewController2") as UIViewController } self.window?.rootViewController = vc window?.makeKeyAndVisible() return true
|
请发表评论