How can I switch views programmatically in a view controller? (Xcode, iPhone)
storyboard, swift, swift3, uiviewcontroller
Solution
If you're in a Navigation Controller:
ViewController *viewController = [[ViewController alloc] init];
[self.navigationController pushViewController:viewController animated:YES];
or if you just want to present a new view:
ViewController *viewController = [[ViewController alloc] init];
[self presentViewController:viewController animated:YES completion:nil];
Problem
Have been struggling with this for a while, and can never seem to get a direct answer. Any help is appreciated!