Search code examples
swiftsegueuisplitviewcontroller

How can I perform a segue from single view controller to split view controller? Swift


I want user to login before going to split view controller. I tried to create a push segue then call the performSegueWithIdentifier. An error comes out. It says "Terminating app due to uncaught exception 'NSGenericException', reason: 'Could not find a navigation controller for segue 'fromLoginToTask'. Push segues can only be used when the source controller is managed by an instance of UINavigationController.'"

Thanks.


Solution

  • I think what you want is to utilize UIViewControllerTransitioningDelegate UIViewControllerTransitioningDelegate Protocol Reference

    It's a bit more work to implement, but it should do the proper changing of root view controllers which I think is the issue when trying to use a segue how you describe.