本文介绍了社交框架iOS 8迅速的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

所以我一直在编写一个需要使用社交框架通过twitter和facebook分享文本的应用程序。

So I've been writing an app that needs to use Social framework to share text via twitter and facebook.

我得到了它的工作,但它没有解散(?),然后我记得完成处理程序,但无论我做什么,这个处理程序一直给我错误。

I got it to work but it did not dismiss (?), then I remembered the completion handler, but whatever I do this handler keeps on giving me errors.

var okFacebook :Bool = SLComposeViewController.isAvailableForServiceType(SLServiceTypeFacebook)
var okTwitter :Bool = SLComposeViewController.isAvailableForServiceType(SLServiceTypeTwitter)
var okLinkedIn : Bool = SLComposeViewController.isAvailableForServiceType(SLServiceTypeLinkedIn)
var socialVC :SLComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeTwitter)

socialVC.completionHandler = SLComposeViewControllerCompletionHandler(SLComposeViewControllerResult) -> Void
self.presentViewController(socialVC, animated: true, completion: nil)


推荐答案

尝试以下代码,尚未测试

Try the following code, not yet tested

 socialVC.completionHandler = {
    (result:SLComposeViewControllerResult) in
        // Your code
    }

这篇关于社交框架iOS 8迅速的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-09 01:46