My UISplitViewController
basically works like a charm except that there is an annoying error message displayed when transitioning the first time (first time only!) from the master table view to the detail view.
Unbalanced calls to begin/end appearance transitions for <UINavigationController: 0x160015600>.
Both the master and the detail view controller are embedded in a UINavigationController
. However, the error only occurs when setting the following (which is necessary for logic behavior on the iPhone):
class MySplitViewController: UISplitViewController, UISplitViewControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
self.delegate = self
}
func splitViewController(splitViewController: UISplitViewController, collapseSecondaryViewController secondaryViewController: UIViewController, ontoPrimaryViewController primaryViewController: UIViewController) -> Bool {
return true
}
}
It would be great if anyone could provide a solution to this issue, thanks in advance.
BTW: the split view controller was set up in the storyboard
Presenting the detail view controller is done in the tableView:didSelectRowAtIndexPath:
method like this:
if let detailViewController = delegate as? DetailViewController {
detailViewController.navigationItem.leftItemsSupplementBackButton = true
detailViewController.navigationItem.leftBarButtonItem = splitViewController!.displayModeButtonItem()
splitViewController!.showDetailViewController(detailViewController.navigationController!, sender: self)
}