1
我創建了一個按鈕,在Facebook與SLComposeViewController
共享狀態。 如何檢查用戶是否確實點擊分享了狀態?如何檢測用戶與SLComposeViewController成功共享
我的如下代碼:
@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)
}
}