title: Open website with SFSafariViewController from UITextView auto detected link
body: <p>I have a <code>UIViewController</code> with a <code>UITextView</code> that auto-detects hyperlinks in its text. It works properly, but I'd to use <code>SFSafariViewController</code> to open the links so I stay "inside" my app, rather than opening a separate browser, which is the "out of the box" behavior.</p>
  
  <p>I've taken the steps outline below, but websites still open a separate Safari browser, rather than inside my app. I get no errors or warnings, but the websites detected still open in a separate browser, not within my app. The <code>UITextViewDelegate</code> method doesn't appear to be getting called (I threw a log statement in to check).</p>
  
  <p>I looked at <code>UITextViewDelegate</code> and I think I want to use this method to open the website that's detected by the <code>UITextView</code>:</p>
  
  <pre><code>- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange {
      // Fill code in here to use SFSafariViewController
      return YES;
  }
  </code></pre>
  
  <p>What I've done so far:</p>
  
  <p>1) Imported SafariServices, made delegate declaration, and declared a delegate property in MyViewController.<strong>h</strong></p>
  
  <pre><code>@import SafariServices;
  
  @interface MyViewController : UIViewController &lt;UITextViewDelegate, SFSafariViewControllerDelegate&gt;
  
  @property(nonatomic, weak, nullable) id&lt; SFSafariViewControllerDelegate, SFSafariViewControllerDelegate &gt; delegate;
  </code></pre>
  
  <p>2) Added a delegate section to my .m file and tried to fill in this method from the stub above:</p>
  
  <pre><code>- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange {
      SFSafariViewController *websiteToOpen = [[SFSafariViewController alloc]initWithURL:URL entersReaderIfAvailable:YES];
      websiteToOpen.delegate = self;
      [self presentViewController:websiteToOpen animated:YES completion:nil];
      return YES;
  }
  </code></pre>
  
  <p>I'm certain it's 100% me mucking this up, but I'm unable to get over the finish line. What am I missing?</p>