title: How can I share a string through email and imessage from my iOS app?
body: <p>My webview opens up a specific URL, and I have it set up where if a user taps the search button, the following dialogue appears:</p>
  
  <p><img src="https://i.stack.imgur.com/hENXB.png" alt="enter image description here"></p>
  
  <p>How do I allow a user to share the url string when they tap each respective button? This is what I have so far:</p>
  
  <pre><code>- (IBAction)shareButtonAction:(id)sender {
      UIActionSheet *popup = [[UIActionSheet alloc] initWithTitle:@"Select Sharing option:" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:
                              @"Share via E-mail",
                              @"Share via iMessage",
                              nil];
      popup.tag = 1;
      [popup showInView:[UIApplication sharedApplication].keyWindow];
  }
  
  - (void)actionSheet:(UIActionSheet *)popup clickedButtonAtIndex:(NSInteger)buttonIndex {
  
      switch (popup.tag) {
          case 1: {
              switch (buttonIndex) {
                  case 0:
                      NSLog(@"lets share on email");
                      break;
                  case 1:
                      NSLog(@"lets share on iMessage");
                      break;
                  default:
                      break;
              }
              break;
          }
          default:
              break;
      }
  }
  </code></pre>