我在应用中创建了一个按钮,用SLComposeViewController
在 Facebook 上分享状态。 如何检查用户是否真的点击以分享状态?
我的代码如下:
@IBAction func fbBtn(_ sender: Any) {
if SLComposeViewController.isAvailable(forServiceType: SLServiceTypeFacebook) {
let fbShare:SLComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
self.present(fbShare, animated: true, completion: nil)
} else {
let alert = UIAlertController(title: "Accounts", message: "Please login to a Facebook account to share.", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true, completion: nil)
}
}
答案 0 :(得分:1)
问题解决了TQ
var delegate: alertDelegate?