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?