我想在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)