title: How to use shouldStartLoadWithRequest method of UIWebView Delegate
body: <p>I need to remove the hyperlinks from the URL shown in UIWebView and I have looked at this question: <a href="https://stackoverflow.com/questions/7787840/removing-hyper-links-from-a-url-shown-in-uiwebview">Removing hyper links from a URL shown in UIWebView</a>.</p>
  
  <p>I know I need to use this method:</p>
  
  <pre><code>- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
  </code></pre>
  
  <p>But I still seem to have some problems.</p>
  
  <p>Firstly, how do i avoid only certain links (for example: www.google.com).</p>
  
  <p>Next, how do i avoid all links in my UIWebView?</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>[webUI loadHTMLString:[strDescription stringByDecodingHTMLEntities] baseURL:nil];
  webUI.dataDetectorTypes = UIDataDetectorTypeNone;
  
  - (void)webViewDidFinishLoad:(UIWebView *)webView {
      NSLog(@"finish loading");
  
      [webUI stringByEvaluatingJavaScriptFromString:@"document.styleSheets[0].addRule(\".active\", \"pointer-events: none;\");document.styleSheets[0].addRule(\".active\", \"cursor: default;\")"];
  
  }
  
  - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
  {
         return YES;
  }
  </code></pre>
  
  <p>Need some guidance. Thanks..</p>
  
  <p>The HTML string looks like this:</p>
  
  <pre><code>&gt; &lt;div style="font-family: Helvetica"&gt;&lt;div style="color: #FFFFFF;"&gt;&lt;div
  &gt; style="font-family: Helvetica;"&gt;&lt;p&gt;&lt;span style="font-size:
  &gt; 24px;"&gt;&lt;strong&gt;Optimal Performance Always&lt;/strong&gt;&lt;/span&gt;&lt;span
  &gt; style="font-size: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:
  &gt; 18px;"&gt;The standard servicing package&lt;a
  &gt; href="http://www.google.com"&gt;www.google.com&lt;/a&gt;&lt;/div&gt;
  </code></pre>