问题
Is there any tutorial to integrate my iOS 6 app with Twitter and Google. I have searched a lot but I could not find any good example or code. Please anyone guide me.
回答1:
Use this code for twitter in iOS 5,6.
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
[tweetSheet setInitialText:@"Tweeting from my own app! :)"];
[self presentViewController:tweetSheet animated:YES completion:nil];
}
else
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Sorry" message:@"You can't send a tweet right now, make sure your device has an internet connection and you have at least one Twitter account setup" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
}
来源:https://stackoverflow.com/questions/14050554/twitter-integration-in-ios-6-and-google-integration-in-ios-6-app