title: Action not called from UIToolbar button on iOS 11 UISearchController
body: <p>After adapting to the new iOS 11 <code>UISearchController</code> in the <code>NavigationItem</code>, I encountered some problems.</p>
  
  <p>I've added a <code>UIBarButtonItem</code> to the toolbar of the search bar of a <code>UISearchController</code>. This button calls a function when clicked (passed as the action-parameter in the <code>UIBarButtonItem</code> constructor).</p>
  
  <p>Prior to iOS 11, the search bar has been attached to the <code>tableHeaderView</code>, and this worked (and still works) perfectly. The function is called when the button is clicked.</p>
  
  <p>However, in iOS 11 the function is not called even though the implementation is the same.</p>
  
  <p>Any ideas what could be wrong? Or is a bug in iOS 11?</p>
  
  <pre><code>    private func setupSearchController() {
  
          ... 
  
          let toolbar = UIToolbar()
          toolbar.sizeToFit()
  
          // Create bar button item with image.
          let qrBarButton = UIBarButtonItem(image: #imageLiteral(resourceName: "QR Code"), style: .plain, target: nil, action: #selector(didPressQRToolbarButton))
  
          // Add the new button.
          toolbar.items = [qrBarButton]
  
          searchController.searchBar.inputAccessoryView = toolbar
  
          // If the device is on iOS 11, use the "native" search bar placement.
          if #available(iOS 11.0, *) {
              navigationItem.searchController = searchController
  
              // Don't use the large title in the navigation bar.
              navigationController?.navigationBar.prefersLargeTitles = false
          } else {
              // Handled in subclasses.
          }
      }
  
      /// Action for the QR toolbar button
      func didPressQRToolbarButton(sender: Any) {
          ...
          // NOT CALLED
      }
  </code></pre>