I processed the cancellation of a tweet and completed the condition in my completion block, it works, and when I send a duplicate tweet, it shows a duplicate tweet error message, ok, but my problem only after duplicating the error shows that the tweet message is complete, so I want stop tweet completed message in case of duplicate error message, please solve my problem. here is my working code.
self.tweetSheet = [[TWTweetComposeViewController alloc] init];
[self.tweetSheet setInitialText:@"Some message."];
[self.navigationController presentModalViewController:self.tweetSheet animated:YES];
self.tweetSheet.completionHandler = ^(TWTweetComposeViewControllerResult result)
{
NSString * msg;
if (result == TWTweetComposeViewControllerResultCancelled)
{
msg = @"Tweet compostion was canceled.";
}
else if (result == TWTweetComposeViewControllerResultDone)
{
NSLog(@"result %d",result);
msg = @"Tweet composition completed.";
}
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Tweet Status" message:msg delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
[self.tweetSheet dismissModalViewControllerAnimated:YES];
};
}
source
share