Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@IBAction func shareFacebook(sender: AnyObject) {
if SLComposeViewController.isAvailableForServiceType(SLServiceTypeFacebook){
var facebookSheet: SLComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
facebookSheet.setInitialText("Demo")
self.presentViewController(facebookSheet, animated: true, completion: nil)
} else {
var alert = UIAlertController(title: "Hata", message: "Facebook aktif değil", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Tamam", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)
}
//Bu aşağıdaki kodu yazınca herşey dismiss oluyor :) Yani açılan Facebook Share penceresi de. Bari o kalsaydı.
self.dismissViewControllerAnimated(true, completion: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.