Here is an example of how to present iOS’s built in Tweet Compose View. This code simple allocs the view controller, then sets the initial text. After setting the completion handler using a closure (lambda function if you want to get technical) it then finally presents it overtop of our current view.

You need to link the Twitter.framework library with your source to use this code.

#import "Twitter/Twitter.h"

TWTweetComposeViewController *tweetComposeViewController =
[[TWTweetComposeViewController alloc] init];
[tweetComposeViewController setInitialText:@"Tweet Tweet"];
[tweetComposeViewController setCompletionHandler:^(TWTweetComposeViewControllerResult result) {
         [self dismissModalViewControllerAnimated:YES];
     }];
[self presentModalViewController:tweetComposeViewController animated:YES];
iOS 5.0 Tweet Compose View

Leave a Reply

Your email address will not be published. Required fields are marked *