我正在更改 SwRevealViewController 的 RootViewController
我的代码:
let next = self.storyboard?.instantiateViewController(withIdentifier: "SWRevealViewController") as! SWRevealViewController
next.loadView()
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let viewController = mainStoryboard.instantiateViewController(withIdentifier: "MessageViewController") as! MessageViewController
UIApplication.shared.keyWindow?.rootViewController = viewController;
self.present(next, animated: true, completion: nil)
但我得到这个错误:
>Presenting view controllers on detached view controllers is discouraged <ios.MesajDetayViewController: 0x7f8718d646f0>.
怎么解决?