Skip to content

Instantly share code, notes, and snippets.

@eralston
Created December 8, 2013 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eralston/7865288 to your computer and use it in GitHub Desktop.
Save eralston/7865288 to your computer and use it in GitHub Desktop.
A basic demonstration of using SimpleSocial.
@implementation ViewControllerChild
{
// For holding the simple social instance
SimpleSocial *_simpleSocial;
// An outlet to the button, so we can show/hide only when Facebook is available
__weak IBOutlet UIButton *_shareBtn;
}
- (void)viewDidLoad
{
// When the view is loaded, show the button only when Facebook is available
_shareBtn.hidden = ![SimpleSocial isFacebookAvailable];
}
- (IBAction)onShareButtonTouched:(id)sender {
// Lazy instantiation of the SimpleSocial object if we don't already have one
if(!_simpleSocial)
_simpleSocial = [[SimpleSocial alloc] init];
// Show the dialog with the text to be shared
[_simpleSocial showFacebookDialog:@"Text to Share!" withViewController:self];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment