Sk.*_*zad 7 ios instagram swift
我已经完成了以下代码在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)
Run Code Online (Sandbox Code Playgroud)
它在iOS 8.3中运行良好,但iOS 9中缺少Caption.为什么这样,我该如何解决?
不太确定,因为我没有可以尝试的示例项目,但是有什么特殊原因不使用 Swift 字典而不是 NSDictionary 吗?
self.documentController.annotation = ["InstagramCaption": strTitle]
Run Code Online (Sandbox Code Playgroud)
如果您能提供一个示例项目就好了。另外,请记住,Swift 2 仍处于测试阶段,iOS 9 也是如此。我最近在使用 Swift 2 的 OS X El Capitan 中发现了一些错误,即在 Yosemite 上运行的代码无法按预期运行。
| 归档时间: |
|
| 查看次数: |
2205 次 |
| 最近记录: |