我在 Appdelegate.m 中调用 SWRevealViewController
SWRevealViewController *svc = self.revealViewController;
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
FrontVC *homeVC = [storyboard instantiateViewControllerWithIdentifier:@"FrontVC"];
[svc setFrontViewController:homeVC animated:NO];
[svc revealToggleAnimated:YES];
但我无法加载 FrontVC Controller 。 什么是正确的调用方式
最佳答案
对于 Swift 2.2
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let sw = storyboard.instantiateViewControllerWithIdentifier("SWRevealViewController") as! SWRevealViewController
self.window?.rootViewController = sw
let cv = storyboard.instantiateViewControllerWithIdentifier("IDOFCONTROLLER") as! NAMEOFCONTROLLER
let navigationController = UINavigationController(rootViewController: cv)
sw.pushFrontViewController(navigationController, animated: true)
关于ios - SWRevealViewController 无法从 appdelegate.m 调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33147060/