I want to present view controller modally with horizontal flip transition from view controller that already embedded in navigation controller and then when user press Done button modal view should be dismiss and presenting view controller should be appear.
Presenting view controller modally ok and i do that with code:
@IBAction func openCardPreferences(sender: AnyObject) {
let newVC = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle()).instantiateViewControllerWithIdentifier("common") as CommonCardParametrsViewController
self.presentViewController(newVC, animated: true, completion: {
})
}
but dismissing modal view controller back me to navigation's controller root view controller, not to "presenting view controller"
@IBAction func applyChanges() {
println(self.presentingViewController)
// self.delegate?.doneButtonPressed?()
self.dismissViewControllerAnimated(true, completion: {})
}
As you may see i trying to dismiss controller with delegate method, but this doesn't resolve my problem.
It is interesting that log self.presentingViewController
return UINavigation controller
instance.
I don't understand what happened. What i doing wrong?