Created
December 8, 2013 23:49
-
-
Save eralston/7865288 to your computer and use it in GitHub Desktop.
A basic demonstration of using SimpleSocial.
This file contains 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
@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