-4

I am new to iOS programming.I am building my first game and I want to use 2 UIViewControllers in my storyboard.

First ViewContoller --> for Menu Options, say "MenuViewController".

Second ViewContoller --> for the game, say "GameViewController".

What I want is when a user clicks on "PLAY" button in MenuViewContoller, GameViewContoller should allocate, and after a certain event has occurred in GameViewController, MenuViewController should appear and GameViewController should deallocate.

Any help would be appreciated.

Thanks.

tereško
  • 58,060
  • 25
  • 98
  • 150
user3805150
  • 3
  • 1
  • 4

1 Answers1

1

Take one Navigation controller. Set 'Menu' controller as Root view controller of Navigation controller.

Then, On Game Button - Click event, Simple Push 'Game' controller in Navigation controller. So it will allocate. But Menu will still remain in stack of navigation.

Then, after certain period of time, Simply Pop 'Game' controller. So it'll redirect to 'Menu' Controller.

This scenario may be help you.
Thanks.

Manann Sseth
  • 2,745
  • 2
  • 30
  • 50