Search code examples
ios8ios-app-extension

ios 8 Application Extension to show UIAlertView like view instead of modal UIViewController?


I am trying to create the Application Extension with an UIAlertView like view (UIWindowLevelStatusBar Of limited width and height), similar to the way a (UITextView and UIButtons dialog) we share a tweet or post appears from UIActivityViewController

I have added Action Extension from File > New > Target > Application Extension.

enter image description here

I selected "Presents User Interface". Now, I got ActionViewController and MainInterface.storyboard. I changed the height (250), tint (red), background (clear color), alpha (0.5) of View Controller in Storyboard. When I run the simulator with Safari, and tap share. I see a extension available there.

And when I press it I see this screen:

enter image description here

As the Plan B, I selected "No User Interface" from the above image. And tried to access "window" from "appDelegate" to put in its subview. But figure out from here : App Extension Programming Guide

"Access a sharedApplication object, and so cannot use any of the methods on that object"

My question is:

Can I show an Action App Extension like a UIAlertView and take some input? How?

Thanks


Solution

  • Alrite guys, I found the main issue. In new iOS 8 SDK, you cannot get rid of UIViewController through Application Extension so far I have concluded the best bet would be to use Action Extension. If anybody find a good way, please care to share :)