title: UIBarButtonItem - Argument of '#selector' cannot refer to local function - Swift 3
body: <p>I am having a problem with creating a nav button that would call <code>handleSearch</code> function. I receive a message <code>Argument of '#selector' cannot refer to local function</code>. Any help would be appreciated! </p>
  
  <pre><code>override func viewDidLoad() {
     // various code
  
     func setupNavBarButtons() {
         let searchImage = UIImage(named:"search_icon")
         let searchBarButtonItem = UIBarButtonItem(image: searchImage, style: .plain, target: self, action: #selector(handleSearch(sender:)))
          navigationItem.rightBarButtonItems = [searchBarButtonItem]
  
      }
  
      func handleSearch(sender: UIBarButtonItem) {
          print(123)
      }
  }
  </code></pre>