Created
May 28, 2015 16:39
-
-
Save burhanaksendir/5253d780c50f45b7910e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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