完成社交分享后开始冥想

时间:2015-08-31 18:27:23

标签: ios swift segue facebook-social-plugins

我想让用户在社交框架的帮助下分享我应用中的一些帖子。但是在社交框架中的post按钮之后,segue没有启动。我怎么处理这个?

var shareToFacebook : SLComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
shareToFacebook.addImage(self.Img.image)
self.presentViewController(shareToFacebook, animated: true, completion: nil)
self.performSegueWithIdentifier("goToStarting", sender: self)

1 个答案:

答案 0 :(得分:1)

您必须在此方法中显示视图控制器

var completionHandler: SLComposeViewControllerCompletionHandler!

您可以像这样使用上述方法

var shareToFacebook : SLComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
shareToFacebook.addImage(self.Img.image)
shareToFacebook.completionHandler = {
    (result:SLComposeViewControllerResult) in

    }
self.presentViewController(shareToFacebook, animated: true, completion: nil)
self.performSegueWithIdentifier("goToStarting", sender: self)