我有一个SignInVC,一个转换到TabbarVC的按钮,而不是用于使用自定义转换的segue。尽管它运行良好,但当我按下调试区域中的登录按钮时,会弹出一个错误。
在SignInVC 中
@IBAction func onTapButton(sender: AnyObject) {
btnFromNib.animate(1, completion: { () -> () in
let myTabbarController = self.storyboard?.instantiateViewControllerWithIdentifier("myTabbarController") as! UITabBarController
let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
appDelegate.window?.rootViewController = myTabbarController
myTabbarController.transitioningDelegate = self
self.presentViewController(myTabbarController, animated: true, completion: nil)
})
}
我做错了什么。。。
提前感谢
由于您正在更改rootViewController
,因此不需要显示它。因此删除这行
self.presentViewController(myTabbarController, animated: true, completion: nil)