Guest User

Untitled

a guest
Jan 19th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. - (IBAction)twitterPost:(id)sender
  2. {
  3. if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
  4. {
  5. mySLComposerSheet = [[SLComposeViewController alloc] init];
  6. mySLComposerSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
  7. [mySLComposerSheet setInitialText:[NSString stringWithFormat:@"This is my tweet, hello!",mySLComposerSheet.serviceType]];
  8. [self presentViewController:mySLComposerSheet animated:YES completion:nil];
  9. }
  10. [mySLComposerSheet setCompletionHandler:^(SLComposeViewControllerResult result) {
  11. NSLog(@"dfsdf");
  12. switch (result) {
  13. case SLComposeViewControllerResultCancelled:
  14. break;
  15. case SLComposeViewControllerResultDone:
  16. break;
  17. default:
  18. break;
  19. }
  20. }];
  21.  
  22.  
  23. }
  24.  
  25. [mySLComposerSheet setCompletionHandler:^(SLComposeViewControllerResult result) {
  26. [mySLComposerSheet dismissViewControllerAnimated:YES completion:nil];
Add Comment
Please, Sign In to add comment