Possible Duplicate:
iOS 5 Attach photo to Twitter with Twitter API
Some Twitter clients have a photo tweet feature. Does the iOS 5 Twitter API also include a way to tweet a photo?
Possible Duplicate:
iOS 5 Attach photo to Twitter with Twitter API
Some Twitter clients have a photo tweet feature. Does the iOS 5 Twitter API also include a way to tweet a photo?
Read this : TWTweetComposeViewController Class Reference and the - addImage property
There is need to use TWTweetComposeViewController Class Reference
Refer ios-5-attach-photo-to-twitter-with-twitter-api link for code.
Yes of course
if ([[[UIDevice currentDevice] systemVersion] floatValue] > 5.0) {
// Create the view controller
TWTweetComposeViewController *twitter = [[TWTweetComposeViewController alloc] init];
// Optional: set an image, url and initial text
[twitter addImage:[UIImage imageName:@"YourImage.png"]];
[twitter setInitialText:@"I created this photo Download http://www.twetter.com"];
// Show the controller
[self presentModalViewController:twitter animated:YES];
// Called when the tweet dialog has been closed
twitter.completionHandler = ^(TWTweetComposeViewControllerResult result)
{
NSString *title = @"Tweet Status";
NSString *msg;
if (result == TWTweetComposeViewControllerResultCancelled)
msg = @"Tweet compostion was canceled.";
else if (result == TWTweetComposeViewControllerResultDone)
msg = @"Tweet composition completed.";
// Show alert to see how things went...
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:title message:msg delegate:self cancelButtonTitle:@"Okay" otherButtonTitles:nil];
[alertView show];
// Dismiss the controller
[self dismissModalViewControllerAnimated:YES];
};
}