Skip to content

Instantly share code, notes, and snippets.

@kirang89
Last active August 29, 2015 14:01
Show Gist options
  • Save kirang89/27cc42448dc33c10fd6e to your computer and use it in GitHub Desktop.
Save kirang89/27cc42448dc33c10fd6e to your computer and use it in GitHub Desktop.
Implementing FB sharing in iOS
#
# Make sure to add Social.Framework to the list of dependencies
#
#import "Social/Social.h"
#import "Accounts/Accounts.h"
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
{
SLComposeViewController *composeController = [SLComposeViewController
composeViewControllerForServiceType:SLServiceTypeFacebook];
[composeController setInitialText:@"Check this out"];
[composeController addImage:someImage];
[self presentViewController:composeController animated:YES completion:nil];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment