如何避免在分离的视图控制器上显示视图控制器

时间:2016-04-24 16:05:38

标签: ios swift segue uistoryboard rootview

我有4个故事板:简介(Root),Loading,ChooseHouse,Home

如果用户登录我设置以root身份加载以加载该用户的数据,就像我在didFinishLaunchingWithOptions方法上一样:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    let user = getUser()
    if(user != nil) {
        let storyboard = UIStoryboard(name: "Loading", bundle: nil)
        let loading = storyboard.instantiateInitialViewController()
        self.window?.rootViewController = loading
    }
    return true
}

用户登录后,他需要选择房子,当他选择房子时,他会去家里

N.B:我使用self.performSegueWithIdentifier(segue, sender: self)作为模式在故事板之间进行划分

当用户退出并返回“家庭”时出现问题。到'介绍' (我也在这里使用self.performSegueWithIdentifier("housesSegue", sender: self)作为模态,当用户第二次登录" LoginView"在' Intro' storyboard中我收到此错误:

Presenting view controllers on detached view controllers is discouraged <LoginViewController: 0x162d3a70>.

0 个答案:

没有答案