2

same as the title above. Please provide helpful link if possible. Googled it but did not find anything regarding Spritebuilder and uiviewcontroller integration. As it is needed for me to set up Google Analytics screen tag method inside viewDidLoad() method.

Thanks

Niaz Mohammad
  • 41
  • 1
  • 8

1 Answers1

0

This code will allow you to present UIViewController above your CCScene.

    MyViewController *vc=[[MyViewController alloc]initWithNibName:@"MyViewController" bundle:nil];
UIViewController *rootViewController=[UIApplication sharedApplication].keyWindow.rootViewController;
if (!rootViewController) {
    //some devices have no root view controller so... this code fix the issue
    [[CCDirector sharedDirector]presentModalViewController:vc animated:YES];
}else{
    [rootViewController presentViewController:vc animated:NO completion:nil];

}
daniel kilinskas
  • 3,458
  • 3
  • 14
  • 10