How to present a modal view controller on an iphone without a “current” view controller?

I am trying to open an email view controller ( MFMailComposeViewController ) and all I read suggests using presentModalViewController:animated: which seems to need to be sent to a UIViewController .

For example, the documentation says:

Call the presentModalViewController:animated: method of the current view controller, passing it to the view controller that you want to present using the method.

But I don’t have a “current view controller”! My application is otherwise completely OpenGL, and my installation code looks like this:

 self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.view = [[IPhoneView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; [window addSubview: self.view]; [window makeKeyAndVisible]; 

and I set the OpenGL context in the IPhoneView class.

I found a few questions to find out how to get the UIViewController from UIView , and there seems to be consensus: t. So, how can I open the email view controller with this awesome moving animation?

+4
source share
1 answer

You can always make your own moving view animation and just pass the MFMailComposeViewController to it: Hidden drawer example

See a similar rolling code here: How can I present a UIView from the bottom of the screen, for example, a UIActionSheet?

+1
source

All Articles