sorry question without code.but didn't find anywhere for. want share image title in instagram? how can that?
any great
class viewcontroller: uiviewcontroller, uidocumentinteractioncontrollerdelegate { var yourimage: uiimage? var documentcontroller: uidocumentinteractioncontroller! func sharetoinstagram() { let instagramurl = nsurl(string: "instagram://app") if (uiapplication.sharedapplication().canopenurl(instagramurl!)) { let imagedata = uiimagejpegrepresentation(yourimage!, 100) let captionstring = "caption" let writepath = (nstemporarydirectory() nsstring).stringbyappendingpathcomponent("instagram.igo") if imagedata?.writetofile(writepath, atomically: true) == false { return } else { let fileurl = nsurl(fileurlwithpath: writepath) self.documentcontroller = uidocumentinteractioncontroller(url: fileurl) self.documentcontroller.delegate = self self.documentcontroller.uti = "com.instagram.exlusivegram" self.documentcontroller.annotation = nsdictionary(object: captionstring, forkey: "instagramcaption") self.documentcontroller.presentopeninmenufromrect(self.view.frame, inview: self.view, animated: true) } } else { print(" instagram isn't installed ") } } } } now still wont work ios 9, have go apps info.plist, add "lsapplicationqueriesschemes" type: array, , add url scheme in case "instagram".
Comments
Post a Comment