Skip to content

Instantly share code, notes, and snippets.

@amratab
Created May 27, 2016 10:16
Show Gist options
  • Save amratab/709bd1e0407dec579987d5b9d9f47524 to your computer and use it in GitHub Desktop.
Save amratab/709bd1e0407dec579987d5b9d9f47524 to your computer and use it in GitHub Desktop.
// for standard dialog which does not take text
let content: FBSDKShareLinkContent = FBSDKShareLinkContent()
content.quote = self.movie.overview
content.contentURL = NSURL(string: "https://www.themoviedb.org/movie/271110-captain-america-civil-war?language=en")
FBSDKShareDialog.showFromViewController(self, withContent: content, delegate: nil)
// for dialog to open inside app..can include text and image
let content: FBSDKShareLinkContent = FBSDKShareLinkContent()
content.contentTitle = self.movie.title
content.contentDescription = self.movie.overview
content.imageURL = NSURL(string: MovieApiContants.Constants.ImageBaseURL + MovieApiContants.ImageSizeKeys.Poster + movie.posterPath!)
let dialog : FBSDKShareDialog = FBSDKShareDialog()
dialog.mode = FBSDKShareDialogMode.Native
dialog.shareContent = content
dialog.fromViewController = self
dialog.delegate = nil
dialog.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment