views:

68

answers:

1

I'm trying to open the email view controller (MFMailComposeViewController), and everything I read suggests using presentModalViewController:animated:, which seems to need to be sent to a UIViewController.

For example, in the documentation, it says:

Call the presentModalViewController:animated: method of the current view controller, passing in the view controller you want to present modally.

But I don't have a "current view controller"! My app is otherwise entirely OpenGL, and my setup code looks like:

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 up the OpenGL context in the IPhoneView class.

I've found a number of questions asking how to get a UIViewController from a UIView, and the consensus seems to be: don't. So how can I open the email view controller with that nifty sliding animation?

+1  A: 

You can always do your own sliding animation of a view and just pass MFMailComposeViewController to it: Hidden Drawer example

See a similar sliding code here as well: http://stackoverflow.com/questions/3357034/how-can-i-present-a-uiview-from-the-bottom-of-the-screen-like-a-uiactionsheet/3357114#3357114

iWasRobbed