-
-
Save jhoughjr/3350248 to your computer and use it in GitHub Desktop.
wtf
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
- (void) aButtonTapped:(id)sender | |
{ | |
if (sender == _shareWithFacebookButton) | |
{ | |
DLog(@"shareWithFaceBookButton tapped"); | |
if (_facebookController == nil) { | |
[self setFacebookController:[[DBFacebookController alloc] init]]; | |
} | |
if ([_facebookController hasAccessToken] == NO) { | |
DLog(@"no access token"); | |
[self login:self]; | |
}else{ | |
DLog(@"has access token"); | |
[self post]; | |
} | |
} | |
if (sender == _tweetButton) | |
{ | |
DLog(@"tweetButton tapped"); | |
if ([TWTweetComposeViewController canSendTweet]) { | |
TWTweetComposeViewController *tweetSheet = | |
[[TWTweetComposeViewController alloc] init]; | |
[tweetSheet setInitialText:@"Initial Tweet Text!"]; | |
[self presentViewController:tweetSheet | |
animated:YES | |
completion:nil]; | |
}else { | |
// twitter isnt set up | |
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Uh-oh" | |
message:@"It seems your Twitter account is not set up. You can do this in the Twitter section of the Settings app." | |
delegate:nil | |
cancelButtonTitle:@"Ok" | |
otherButtonTitles:nil, nil]; | |
[alert show]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment