Skip to main content
Inspiring
August 14, 2012
Answered

Can an ANE render iOS display controls?

  • August 14, 2012
  • 2 replies
  • 1057 views

I'm trying to add the iOS video player within my app. It looks like you can use StageWebView to launch it but I saw someone had an ANE that handled it using iOS UI controls. Does anyone have a tutorial out there on how to build an ANE that adds Native UI elements? I've only ever seen data being transmitted back and forth via alerts.

This topic has been closed for replies.
Correct answer mbhagya

Hey,

You can access(and not modify) the rootViewController in the following way:

[[[UIApplication sharedApplication] keyWindow] rootViewController]

Once you have the rootViewController, you can use that to add subviews to the current view:

[[[[[UIApplication sharedApplication] keyWindow] rootViewController] view] addSubview:(UIView *)myView]

Alternatively, you can add childViewControllers to the rootViewController.

-mayank

2 replies

mbhagya
mbhagyaCorrect answer
Participating Frequently
August 14, 2012

Hey,

You can access(and not modify) the rootViewController in the following way:

[[[UIApplication sharedApplication] keyWindow] rootViewController]

Once you have the rootViewController, you can use that to add subviews to the current view:

[[[[[UIApplication sharedApplication] keyWindow] rootViewController] view] addSubview:(UIView *)myView]

Alternatively, you can add childViewControllers to the rootViewController.

-mayank

Inspiring
August 14, 2012

Thanks mbhagya,

I ended up going with StageWebView to save time but I'll need this in the future!