小编use*_*619的帖子

Swift:通过Twitter分享文字

所以基本上我正在制作一个活动应用.一切都进展顺利,但只是将活动分享到Twitter.

我已经搜索了互联网,但我得到的只是使用我不想要的Twitter原生应用程序.我想用浏览器发推文.

我已经为FB共享实现了这种方法.

任何想法都会对我有所帮助.

let content = FBSDKShareLinkContent()

    content.contentURL=NSURL(string: "http://facebook.com")
    content.imageURL = NSURL(string: "http://facebook.com")

    content.contentTitle = "Shou 3emlin test app "
    content.contentDescription = "testing testing testing"

    let shareDialog = FBSDKShareDialog()
    shareDialog.fromViewController = self
    shareDialog.mode=FBSDKShareDialogMode.Browser
    shareDialog.shareContent = content


    if !shareDialog.canShow() {
        shareDialog.mode=FBSDKShareDialogMode.Native
        shareDialog.shareContent = content
    }

    if shareDialog.canShow() {
        shareDialog.show()
    }
Run Code Online (Sandbox Code Playgroud)

twitter xcode sharing swift

2
推荐指数
2
解决办法
5775
查看次数

标签 统计

sharing ×1

swift ×1

twitter ×1

xcode ×1