我试图在iOS应用中实现向Instagram发布图像。我在这篇文章中使用了代码。无法将类型'String'的值转换为期望的参数类型'URL'
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)
的斯威夫特3,但当时我得到的错误:
Cannot convert value of type 'String' to expected argument type 'URL'
李四有人知道如何解决这个问题吗?
谢谢。
你逝去的字符串,而非网址。 – Wolverine
什么是jpgPath –