Add Twitter Support To Your iPhone App In 5 Steps - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Sunday, January 8, 2012

Add Twitter Support To Your iPhone App In 5 Steps

Do you know how easy it is to give your users Twitter support in your app. This works like the email function in iOS apps – you will be able to present your user with a model view that is pre-populated with content that will become a tweet that will appear in your user's timeline.

This is what you need to do to add Twitter support to your iOS app:
  • Add Twitter framework
  • Import Twitter.h
  • Instantiate TWTweetComposeViewController
  • Set initial text, images and URLs
  • Present TWTweetComposeViewController in a model view controller

Here is an IBAction that I coded that implements this Twitter functionality.

-(IBAction)tweetTweet:(id)sender {     NSLog(@"%i", [TWTweetComposeViewController canSendTweet]);     TWTweetComposeViewController *tweeter = [[TWTweetComposeViewController alloc] init];     [tweeter setInitialText:self.myTextField.text];     [self presentModalViewController:tweeter animated:YES]; }

No comments:

Post a Comment