SHARE
TWEET

Untitled

a guest Feb 20th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if([TWTweetComposeViewController canSendTweet])
  2.     {
  3.     TWTweetComposeViewController *tweetSheet = [[TWTweetComposeViewController alloc] init];
  4.     [tweetSheet setInitialText:@"text to send"];
  5.     [tweetSheet addImage:[UIImage imageNamed:@"imageToSend"]];
  6.  
  7.     [self presentModalViewController:tweetSheet animated:YES];
  8.  
  9.     tweetSheet.completionHandler = ^(TWTweetComposeViewControllerResult result)  {
  10.       [self dismissModalViewControllerAnimated:YES];
  11.       switch (result) {
  12.         case TWTweetComposeViewControllerResultCancelled:
  13.             break;
  14.         case TWTweetComposeViewControllerResultDone:
  15.             break;
  16.         default:
  17.             break;
  18.        }
  19.      };
  20.    }else
  21.    {
  22.     // you can show alert here
  23.    }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top