Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I close UIVIewController?

I have a MainWindowController that I want to close on "touch inside" button event and open a new UIView. The code that I use is this:

NewViewController *controller = [[NewViewController alloc]
initWithNibName:@"NewView" bundle:nil];
controller.delegate = self;
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];
[controller release];

But in this way the MainWindowController don't close it self.

like image 293
JAEP Avatar asked Dec 22 '22 17:12

JAEP


1 Answers

Try this one

[self dismissViewControllerAnimated:YES completion:nil];
like image 95
MahboobiOSDeveloper Avatar answered Jan 05 '23 07:01

MahboobiOSDeveloper