iPad: Configuring the split-view controller should happen in init(), not loadView()
This commit is contained in:
parent
f8f19ef3d7
commit
1bba1ffe16
|
@ -6,18 +6,23 @@ import UIKit
|
||||||
class MainViewController: UISplitViewController {
|
class MainViewController: UISplitViewController {
|
||||||
var tunnelsListVC: TunnelsListTableViewController?
|
var tunnelsListVC: TunnelsListTableViewController?
|
||||||
|
|
||||||
override func loadView() {
|
init() {
|
||||||
let detailVC = UIViewController()
|
let detailVC = UIViewController()
|
||||||
|
detailVC.view.backgroundColor = UIColor.white
|
||||||
let detailNC = UINavigationController(rootViewController: detailVC)
|
let detailNC = UINavigationController(rootViewController: detailVC)
|
||||||
|
|
||||||
let masterVC = TunnelsListTableViewController()
|
let masterVC = TunnelsListTableViewController()
|
||||||
let masterNC = UINavigationController(rootViewController: masterVC)
|
let masterNC = UINavigationController(rootViewController: masterVC)
|
||||||
|
|
||||||
|
self.tunnelsListVC = masterVC
|
||||||
|
|
||||||
|
super.init(nibName: nil, bundle: nil)
|
||||||
|
|
||||||
self.viewControllers = [ masterNC, detailNC ]
|
self.viewControllers = [ masterNC, detailNC ]
|
||||||
|
}
|
||||||
|
|
||||||
super.loadView()
|
required init?(coder aDecoder: NSCoder) {
|
||||||
|
fatalError("init(coder:) has not been implemented")
|
||||||
tunnelsListVC = masterVC
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
|
|
Loading…
Reference in New Issue