Created
April 9, 2015 17:29
-
-
Save benaneesh/639548625732b9b6cf59 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| let tweetSheet = SLComposeViewController(forServiceType: SLServiceTypeTwitter) | |
| tweetSheet.setInitialText(myText) | |
| tweetSheet.addImage(myImage) | |
| tweetSheet.addURL(myUrl) | |
| tweetSheet.completionHandler = ({ | |
| switch($0) { | |
| case .Cancelled: | |
| // means the user cancelled without sending the Tweet | |
| break | |
| case .Done: | |
| // Successfully sent | |
| break | |
| } | |
| }) | |
| self.presentViewController(tweetSheet, animated: true, completion: { () -> Void in | |
| // | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment