Swift - SLComposeViewController 自动关闭自身

Swift - SLComposeViewController automatically dismissing itself

我正在使用 SLComposeViewController 进行 photos.But 的社交分享 我在日志

中收到此错误

SLComposeViewController automatically dismissing itself

我的代码:-

@IBAction func fbshare(_ sender:UIButton) {
    let vc = SLComposeViewController(forServiceType:SLServiceTypeFacebook)
    vc?.add(img.image!)
    vc?.add(URL(string: "http://www.example.com/"))
    vc?.setInitialText("Initial text here.")
    self.present(vc!, animated: true, completion: nil)
}

我无法在屏幕上显示 SLComposeViewController

这对 SLServiceTypeFacebook 也有效,但需要关闭一个才能显示另一个。我还在解决这个问题。

if let vc = SLComposeViewController(forServiceType: SLServiceTypeTwitter) {

        //SLServiceTypeFacebook
        //SLServiceTypeTwitter

        vc.setInitialText(self.writeDBString)
        //vc.add(UIImage(named: "myImage.jpg")!)
        vc.add(URL(string: "https://itunes.apple.com/us/app"))
        present(vc, animated: true )            
}