gilm
gilm

Reputation: 8050

Showing a view controller from an OpenGL view

I have created an iPhone application based on an OpenGL view. Now I would like to show a "settings" form. Since my code runs in UIView, I have no pushViewController. How do I show a view controller on screen?

Thanks!

Upvotes: 3

Views: 1594

Answers (1)

Ben Gottlieb
Ben Gottlieb

Reputation: 85532

You can do this in one of two ways:

  • You can create a new view hierarchy, and then add it as a subview of your UIWindow when you want to show preferences. When you're done with your prefs, you can animate it out and then remove it as a subview.

  • You can switch to a UINavigationController/UIVIewController based hierarchy, and hook your current OpenGL/UIView to a UIViewController's view outlet. Then you can use all the regular UINavigationController based navigation stuff.

Upvotes: 4

Related Questions