ios - I need to show my App in UIActivityViewController for All Applications as Action Extension(Default) -


created new project , added actionextension worked , shows in action activities action extension doesn't show in device when created existing app(old app contains swift , objective-c files) need show app in action extension of uiactivitycontroller unable show every application in device refer image

image1 image2

***query : while in simulator(photos app) shows , doesn't shows in other apps in simulator when run in device doesn't shows in both photos app , others

override func viewdidload() {     super.viewdidload()       // item[s] we're handling extension context.      // example, image , place image view.     // replace appropriate type[s] extension supports.     var imagefound = false     item: anyobject in self.extensioncontext!.inputitems {         let inputitem = item as! nsextensionitem         provider: anyobject in inputitem.attachments! {             let itemprovider = provider as! nsitemprovider             if itemprovider.hasitemconformingtotypeidentifier(kuttypeimage string) {                 // image. we'll load it, place in our image view.                 weak var weakimageview = self.imageview                 itemprovider.loaditemfortypeidentifier(kuttypeimage string, options: nil, completionhandler: { (image, error) in                     nsoperationqueue.mainqueue().addoperationwithblock {                           if let strongimageview = weakimageview {                              if let imageurl = image as? nsurl{                                 strongimageview.image = uiimage(data: nsdata(contentsofurl: imageurl)!)                             }else{                  strongimageview.image = image as? uiimage                             }                         }                      }                 })                  imagefound = true                 break             }         }          if (imagefound) {             // handle 1 image, stop looking more.             break         }     } }  override func didreceivememorywarning() {     super.didreceivememorywarning()     // dispose of resources can recreated. }  @ibaction func done() {     // return edited content host app.     // template doesn't anything, echo passed in items.     self.extensioncontext!.completerequestreturningitems(self.extensioncontext!.inputitems, completionhandler: nil) } 

referred apple documentation , other links

http://code.tutsplus.com/tutorials/ios-8-how-to-build-a-simple-action-extension--cms-22794

on extensions didn't find relevant answer , action extension plist file (refer image)

enter image description here

**i unable show app in uiactivityviewcontroller please help

hey answering own question . able show appextension in uiactivityviewcontroller

i took old project again , added target -> action extension newly

xcode-> file -> create new target -> select action extension -> done

things :

in plist added shown in png

http://i.stack.imgur.com/kbwdil.png

<key>nsextension</key> <dict>     <key>nsextensionattributes</key>     <dict>         <key>nsextensionactivationrule</key>         <dict>             <key>nsextensionactivationsupportsimagewithmaxcount</key>             <integer>1</integer>         </dict>     </dict>     <key>nsextensionmainstoryboard</key>     <string>maininterface</string>     <key>nsextensionpointidentifier</key>     <string>com.apple.ui-services</string> </dict> 

result:

enter image description here

refer links

http://code.tutsplus.com/tutorials/ios-8-how-to-build-a-simple-action-extension--cms-22794

http://www.appcoda.com/tag/app-extension/


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -