【发布时间】:2016-12-07 06:24:47
【问题描述】:
我正在尝试在我的 iOS 应用中将图片发布到 Instagram。我已经使用了这篇文章中的代码。
Post UIImage to Instagram using Swift similar to SLComposeViewController
我需要换行:
UIImageJPEGRepresentation(imageInstagram, 1.0)!.writeToFile(jpgPath, atomically: true)
到:
UIImageJPEGRepresentation(imageInstagram, 1.0)!.write(jpgPath, options: true)
对于 Swift 3,但随后出现错误:
无法将“字符串”类型的值转换为预期的参数类型“URL”
有人知道如何解决这个问题吗?
谢谢。
【问题讨论】:
-
你传递的是字符串而不是 URL。
-
什么是jpgPath