从AppDelegate.swift访问splitViewController中的Tableview

时间:2016-03-13 13:32:36

标签: ios swift uisplitviewcontroller

我搜索了很多但没有成功。我试图从AppDelegate.swift访问splitViewController的TableView。我该怎么做?

这是Apple为Split View Controller启动新项目时提供的标准代码:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        // Override point for customization after application launch.
        let splitViewController = self.window!.rootViewController as! UISplitViewController
        let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController
        navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem()
        splitViewController.delegate = self

        return true
    }

或者也许不可能?我无法相信: - )

0 个答案:

没有答案