Access ViewController in iOS-Native Extension for Adobe Air
The Android-API for Air-Native-Extensions provides a getActivity() on the Context-Object.
I am looking for a way, to get the current ViewController in iOS-Native-Extensions
We need to extend Air with more than just some iOS-API-Calls to access vibration etc, but want to display a View (MPMediaPickerController to select a File from the iTunes library). In the Keynote to native extensions on Adobe MAX 2011 (http://tv.adobe.com/watch/max-2011-develop/how-to-extend-your-mobile-air-applications-using-native-extensions/) Oliver Goldman said, it is okay to show complete Views by using native extensions.
To show the MPMediaPickerController (or any other View), I need to call presentModalViewController on the current ViewController or need access to the Navigation Controller.
I hoped there is a way to get a pointer to the controller somehow, but I have not found any documentaion about it.
- ActionScript's File.upload does not work on Air SDK for iOS devices
- Load and reload external SWF in AIR for iOS
- Adobe Air ios packager
- Flash/AIR Stage Video on iOS - Is It Possible? How is the performance?
- Adobe AIR, IOS, and Multiple SWFs - Returning to a previously loaded SWF
- Receiving Installation Error: ApplicationVerificationFailed in Flash Builder for iOS
Solutions Collect From Internet About “Access ViewController in iOS-Native Extension for Adobe Air”
You can use this piece of code. It works.
UIViewController * myViewController; id delegate = [[UIApplication sharedApplication] delegate]; UIWindow * win = [delegate window]; myViewController = [[MyView alloc] init]; // CGRect rect = CGRectMake(x,y,w,h); // init the view position some how myViewController.viewFrame = rect; [win addSubview:myViewController.view];
Hope this helps.
- fbauth2 is missing from your Info.plist under LSApplicationQueriesSchemes and is required for iOS 9.0
- Cannot understand NSError/NSObject pointer passing behavior
- Does swift copy on write for all structs?
- Store data locally IOS
- AVAudioPlayer, using AmbientSound session, is not playing when app is in background
- Using frameworks in a command line tool
- How to get User Ip address and check that user is online in Ionic\Cordova
- IOS 5 (safari) bug with HTML touch events on “position:fixed” div
- Pass value with action sheet button
- Is there a way to have a different Default.png (splash image) for different languages/locales in iOS?
- Xcode 4.4.1 does not work properly under OSX Mavericks
- Custom login/lock screen in OS X Mavericks
- CCAvenue Gateway Integration kit for ios Application
- Having problems allowing interaction in UIView animation
- How do I get my sound to play when a remote notification is received?