我正在尝试在另一个Storyboard文件中展示并推送到视图控制器。但是我无法摆脱显示TabBar的问题,这是我拥有的代码以及如何设置的屏幕快照。

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
    let rootView = self.window!.rootViewController as! TabBarViewController
    rootView.selectedIndex = 4
    let storyBoard = UIStoryboard(name: "Main", bundle: nil)
    let navVC = storyBoard.instantiateViewControllerWithIdentifier("moreNav") as! UINavigationController
    storyBoard.instantiateViewControllerWithIdentifier("moreView") as! MoreTableViewController
    let vc = navVC.visibleViewController as! MoreTableViewController


    let pdfLockerSB = UIStoryboard(name: "PDFLocker", bundle: nil)
    let pdfvc = pdfLockerSB.instantiateViewControllerWithIdentifier("pdfLockerTable") as! PDFLockerTableViewController

    vc.navigationController?.pushViewController(pdfvc, animated: true)

    return true
}

ios - 从应用程序代理推送 View  Controller-LMLPHP

有什么想法我做错了吗?它是一个UITabBarController,它链接到UINavigationController,后者又链接到UITableViewController。

我已经设置好了segue,但是我不确定为什么它不能执行。使用推送或执行

最佳答案

尝试这个

let navVC: UINavigationController =  rootView.viewControllers![4] as! UINavigationController;
let vc = navVC.topViewController as! MoreTableViewController

代替
let navVC = storyBoard.instantiateViewControllerWithIdentifier("moreNav") as! UINavigationController
let vc = navVC.visibleViewController as! MoreTableViewController

关于ios - 从应用程序代理推送 View Controller ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35884434/

10-14 21:59