Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display a view using modalPresentationStyle

I have heard that you can make a view popup like in the Mail app for iPad by using modalPresentationStyle. Im having a hard time figuring out how to use it though. I looked a this post here and still couldn't figure out how to do this task. If anyone could explain how to hook up the controllers to make this code work that would be great.

Thanks

like image 847
nosedive25 Avatar asked Dec 17 '22 01:12

nosedive25


1 Answers

I think the magic incantation is the following:

myViewController = ..... create your new controller if needed ....
myViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
myViewController.modalPresentationStyle = UIModalPresentationFormSheet;
// "self" here is a ViewController instance
[self presentModalViewController:myViewController animated:YES]

I seem to recall that in portrait the modal takes over the screen; in landscape it will be presented centered in the view.

like image 114
wkw Avatar answered Dec 28 '22 06:12

wkw