title: How to get length of text enter in search bar?
body: <p>I want to get the length of the text that is entered in a <code>UISearchBar</code></p>
  
  <p>I use the function that is called when the the searcbbar text starts editing.</p>
  
  <pre><code>func searchBarTextDidBeginEditing(searchBar: UISearchBar!) {
      println("EDITING")
      //TODO: Get length of text entered in searchBar
  }
  </code></pre>
  
  <p>This doesn't work:</p>
  
  <pre><code>func searchBarTextDidBeginEditing(searchBar: UISearchBar!) {
      println("EDITING")
      //TODO: Get length of text entered in searchBar
      //Doesn't work. Error: String doesn't have a member named length
      searchBar.text.length
  }
  </code></pre>
  
  <p>How can i retrieve the length of the entered text?</p>
  
  <p>Ended up doing this:</p>
  
  <pre><code>searchBar.text.bridgeToObjectiveC().length
  </code></pre>