演示项目https://github.com/john-07/split
在返回之前添加didFinishLaunchingWithOptions行 splitViewController.preferredDisplayMode = .primaryHidden;
let splitViewController = window!.rootViewController as! UISplitViewController
let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController
navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem
splitViewController.delegate = self
splitViewController.preferredDisplayMode = .primaryHidden;
return true
运行程序,然后按右所有 您将看不到主控制器和奇异色调的viewWillAppear
再次运行程序。
按左项目