How to access the game view controller on ios

Hey,

I am not an ios developer, and I might get some terms wrong here.

I am trying to create an AlertViewController in an extension following this: http://hayageek.com/uialertcontroller-example-ios/

This line is the problem:

[self presentViewController:alert animated:YES completion:nil];

“self” refers to some ViewController I guess. But how do I get the View Controller of the Game in an ios extension?

Thanks!

This seems to work:

[[[[UIApplication sharedApplication] keyWindow] rootViewController] presentModalViewController:alert animated:YES];