Skip to content

Instantly share code, notes, and snippets.

@benaneesh
Created April 9, 2015 17:29
Show Gist options
  • Select an option

  • Save benaneesh/639548625732b9b6cf59 to your computer and use it in GitHub Desktop.

Select an option

Save benaneesh/639548625732b9b6cf59 to your computer and use it in GitHub Desktop.
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