4

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?

Community
  • 1
  • 1
Jesse Beder
  • 33,081
  • 21
  • 109
  • 146

1 Answers1

1

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: How can I present a UIView from the bottom of the screen like a UIActionSheet?

Community
  • 1
  • 1
iwasrobbed
  • 46,496
  • 21
  • 150
  • 195