Cancel Button in UISearchController

后端 未结 3 784
名媛妹妹
名媛妹妹 2020-12-17 09:32

In my project I\'m using a UITableViewController with an internal UISearchController to filter the data in my tableView.

I ha

3条回答
  •  旧巷少年郎
    2020-12-17 10:23

    If you implement UISearchResultsUpdating protocol, you can know that cancelled is triggered when active is false.

    func updateSearchResultsForSearchController(searchController: UISearchController) {
        if !searchController.isActive {
            print("Cancelled")
        }
    }
    

提交回复
热议问题