My goal is to prevent the cancel button from appearing in a search bar in a UISearchController. I started with Apple\'s Table Search with UISearchController sample code and
Use UISearchControllerDelegate.
func willPresentSearchController(_ searchController: UISearchController) { searchController.searchBar.setValue("", forKey:"_cancelButtonText") }