title: How to delete appended search elements in swift
body: <p>I have completed search with UISearchController. The search starts after typing 3 characters.  </p>
  
  <p>As you can see in following animated gif, after I delete search and start to type another search, device display previous search results.  These search results remains until I type 3 characters.  </p>
  
  <p>How can I clear previous search after delete or clear ? </p>
  
  <pre><code>if searchController.searchBar.text?.characters.count &gt; 2 { ... }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/d7f5Y.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d7f5Y.gif" alt="enter image description here"></a></p>