4

I'm building a very simple iOS game that doesn't require any OpenGL; I'd like to stick with Core Graphics & Core Animation.

It seems as though I need two types of ViewControllers: Basic VCs for navigating between menu screens (ie. Settings, Main Menu, Level Select, etc.), and Gameplay VCs for managing all my UIViews and CALayers.

What's a good way to manage/exchange these Views & VCs to preserve performance? Is it best practice to have one hierarchy of VCs like a traditional UINavigationController-based app, covering the NavBar when I'm displaying a Game VC? Or instead should I be removing all other ViewControllers from the stack when I enter "game mode", and setting it as my window.rootViewController property? Any alternatives / downsides to continually resetting window.rootViewController?

My gut tells me the latter is better on resources+performance, but it seems heavy handed. Any advice + direction here would be appreciated.

Thanks

1
  • @Moderators - I asked this over at the programmers site as it was "related to high level coding concepts", thought I think it's specific enough to live here as well. Happy to move + edit if necessary. programmers.stackexchange.com/questions/111744/…
    – Chazbot
    Oct 2, 2011 at 2:18

1 Answer 1

4

You can probably make the Game VC the rootViewController, and present the game selection as modal view controller on top of that controller. You can do that without animating at the beginning of the application. When the user is done with the setup, dismiss the view controller.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.