我已经完成了以下代码,以便在Instagram上发布图片和文本
let fileURL = NSURL(fileURLWithPath: writePath)
self.documentController = UIDocumentInteractionController(URL: fileURL)
self.documentController.delegate = self
self.documentController.UTI = "com.instagram.exclusivegram"//"com.instagram.photo"
self.documentController.annotation = NSDictionary(object: strTitle as String, forKey: "InstagramCaption")
self.documentController.presentOpenInMenuFromRect(self.view.frame, inView: self.view, animated: true)它在iOS 8.3中运行良好,但在iOS 9中却缺少标题。为什么会这样?我该如何修复它?
发布于 2015-08-12 19:58:20
我也遇到了同样的问题,我发现它已经在2015年8月初被Instagram删除了。
Instagram博客http://developers.instagram.com/post/125972775561/removing-pre-filled-captions-from-mobile-sharing
发布于 2015-08-11 18:21:53
刚刚发现Instagram在其新版本中删除了此功能
https://www.apichangelog.com/changes/c6542ec9-6e02-4352-8db4-6481a8af4039
发布于 2015-06-24 07:12:11
我真的不确定,因为我没有一个样例项目可以尝试,但有什么特别的原因不使用Swift字典而不是NSDictionary?
self.documentController.annotation = ["InstagramCaption": strTitle]如果你能提供一个示例项目,那就太好了。另外,请记住,Swift 2仍处于测试阶段,iOS 9也是如此。我最近在Swift 2的OS X El Capitan中发现了一些错误,代码在Yosemite上运行不像预期的那样。
https://stackoverflow.com/questions/31012861
复制相似问题