Rob*_*Rob 5 twitter ios slcomposeviewcontroller swift
我只是这样做:
if let vc = SLComposeViewController(forServiceType: SLServiceTypeTwitter) {
vc.setInitialText("Tweet text")
vc.add(image)
present(vc, animated: true)
}
Run Code Online (Sandbox Code Playgroud)
我在我的应用程序中这样做已经很长时间了,它曾经工作得很好,但我最近才意识到它不再工作了。现在,仅显示图像,文本部分为空。那么……发生了什么事,该怎么办?
尝试使用TWTRComposer\xc2\xa0 而不是 \xc2\xa0 SLComposeViewController。TwitterKit提供了具有相同功能的轻量级\xc2\xa0 TWTRComposer\xc2\xa0,并封装了授权用户(如果您的应用程序没有显式登录功能)。
let vc = TWTRComposer()\nvc.setText("Tweet text")\nvc.setImage(UIImage(named: "hi"))\nvc.setUrl(URL(string: "https://dev.twitter.com"))\nvc.show(from: self, completion: nil)\nRun Code Online (Sandbox Code Playgroud)\n\n您可以在此处下载 TwitterKit: https: //dev.twitter.com/twitterkit/ios/overview。
\n| 归档时间: |
|
| 查看次数: |
2982 次 |
| 最近记录: |