Reputation: 280
This is the code I'm using
var xibvc = TestXibViewController()
var navb = UINavigationController(rootViewController: xibvc)
self.presentViewController(xibvc,animated: true, completion: nil)
I'm tying to present xibviewcontroller with a navigation bar, It gives me this error
reason: 'Application tried to present modally an active controller
although, it works fine if i try pushViewController
Upvotes: 0
Views: 1623
Reputation: 535944
Your code makes no sense. What is navb
for? You create it and then you never use it.
You probably meant to say:
self.presentViewController(navb,animated: true, completion: nil)
^^^^
Upvotes: 1