Pushing a view controller onto the navigation stack

suggest change

navigationController is nil when this controller is not on a navigation stack, so the Swift call does nothing.

let fooViewController = UIViewController()
navigationController?.pushViewController(fooViewController, animated: true)
UIViewController *fooViewController = [[UIViewController alloc] init];
[navigationController pushViewController:fooViewController animated:YES];

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents