如何在Twitter上发布而不显示ios中的对话?

我想在twitter上发布我的状态。 我想添加一个图像,但我不想分享对话。

相反,我想要一个像Instagram这样的界面,用户只需selecttwitter并按下“分享”即可,所以很简单。

这是我迄今为止的运行代码:

// Create an instance of the Tweet Sheet SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType: SLServiceTypeTwitter]; // Sets the completion handler. Note that we don't know which thread the // block will be called on, so we need to ensure that any required UI // updates occur on the main queue tweetSheet.completionHandler = ^(SLComposeViewControllerResult result) { switch(result) { // This means the user cancelled without sending the Tweet case SLComposeViewControllerResultCancelled: break; // This means the user hit 'Send' case SLComposeViewControllerResultDone: break; } }; // Set the initial body of the Tweet [tweetSheet setInitialText:@"Socia"]; // Adds an image to the Tweet. For demo purposes, assume we have an // image named 'larry.png' that we wish to attach if (![tweetSheet addImage:[UIImage imageNamed:@"icon120x120.png"]]) { NSLog(@"Unable to add the image!"); } // Add an URL to the Tweet. You can add multiple URLs. if (![tweetSheet addURL:[NSURL URLWithString:@"http://stackoverflow.com/questions/ask?title="]]){ NSLog(@"Unable to add the URL!"); } // Presents the Tweet Sheet to the user [self presentViewController:tweetSheet animated:NO completion:^{ NSLog(@"Tweet sheet has been presented."); }]; 

  [account requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) { if (granted == YES) { // Populate array with all available Twitter accounts NSArray *arrayOfAccounts = [account accountsWithAccountType:accountType]; if ([arrayOfAccounts count] > 0) { //use the first account available ACAccount *acct = [arrayOfAccounts objectAtIndex:0]; //create this request SLRequest *postRequest = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodPOST URL:[NSURL URLWithString:@"https://api.twitter.com"@"/1.1/statuses/update_with_media.json"] parameters: [NSDictionary dictionaryWithObject:message forKey:@"status"]]; UIImage *imageToPost = [UIImage imageNamed:@"image.jpg"]; NSData *imageData = UIImageJPEGRepresentation(imageToPost, 1.0f);//set the compression quality [postRequest addMultipartData:imageData withName:@"media" type:@"image/jpeg" filename:@"image.jpg"]; //set account and same as above code .... .... 

以上是从这个链接 ,这个代码为我工作。

在这里你可以find如何在这里发布Twitter的更新媒体。