UISearchBar searchBarCancelButtonClicked not being called using Swift 3
<p>For some reason when I click the circle x cancel button in a UISearchBar the <strong>searchBarCancelButtonClicked</strong> event is not firing, it worked in a swift 2 project but not in this swift 3 one. </p>

<p>I am now extending my view controller instead of the inline class way but I believe that is working as the <strong>searchBarSearchButtonClicked</strong> event does work. Here is what I have so far:</p>

<pre><code>extension MyViewController: UISearchBarDelegate {
   func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
      print("here?")
      searchBar.resignFirstResponder()
      handleCancelSearch()
    }

    func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
        searchBar.resignFirstResponder()
        if let searchText = searchBar.text {
            performSearchUsing(term:searchText)
        }

    }
}
</code></pre>

<p>The print is not logged and the function not called. Am I missing something silly?</p>