分享我的应用instagram app iOS(swift)的链接

时间:2016-04-27 10:47:01

标签: ios share instagram

我想在Instagram上分享app,图片和文字的app store链接 是不是可以在Instagram上显示预先填写的文字?是否可以通过iOS应用程序在Instagram上分享链接。以下是我的快捷代码请建议我。图片分享成功,如何分享app的链接?

         let image = UIImage(named: "flag_image")
          let documentsURL = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0]

         let destinationPath = documentsURL.URLByAppendingPathComponent("filename.igo")

         if let pngImageData = UIImagePNGRepresentation(image!) {
            pngImageData.writeToURL(destinationPath, atomically: false)
        }

         print(destinationPath.path!)
         self.doc = UIDocumentInteractionController()
         self.doc!.annotation = NSDictionary(object: "my caption", forKey: "InstagramCaption")
          self.doc!.URL = NSURL(fileURLWithPath: destinationPath.path!)
         self.doc!.UTI = "com.instagram.exclusivegram"
         self.doc!.presentOpenInMenuFromRect(CGRectZero, inView: self.view, animated: true) 

0 个答案:

没有答案