Question

I have a popup view from another view controller with an XIB file. It launches from a parent VC (detailViewController) and but the dismiss code is within its own VC (KNThirdViewController)

I'm using this code: https://github.com/kentnguyen/KNSemiModalViewController/blob/master/KNSemiModalViewControllerDemo/KNThirdViewController.xib

When this is called from (KNThirdViewController)

- (IBAction)dismissButtonDidTouch:(id)sender {
    [self dismissModalViewControllerAnimated:NO];
}

The app returns to the rootViewController and not the detailViewController. It should simply dismiss itself (the KNThirdViewController popup VC) and return the user to detailViewController.

The view controller is presented with:

-(void)scriviBtnPress {

// You can also present a UIViewController with complex views in it
// and optionally containing an explicit dismiss button for semi modal
[self presentSemiViewController:semiVC withOptions:@{
 KNSemiModalOptionKeys.pushParentBack    : @(YES),
 KNSemiModalOptionKeys.animationDuration : @(0.5),
 KNSemiModalOptionKeys.shadowOpacity     : @(0.3),
 }];

}

Was it helpful?

Solution 2

dismissModalViewControllerAnimated: method is deprecated in iOS 6.0. why don't try with dismissViewControllerAnimated:completion:

OTHER TIPS

Try like this :

[self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:NULL];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top