Ios UISearchController:在演示过程中,我如何使用模糊背景作为真/假

Ios UISearchController:在演示过程中,我如何使用模糊背景作为真/假,ios,swift,uisearchbar,uisearchcontroller,Ios,Swift,Uisearchbar,Uisearchcontroller,我使用的UISearchController和结果控制器将是相同的 searchController = UISearchController(searchResultsController: nil) searchController?.searchResultsUpdater = self searchController?.searchBar.delegate = self searchController?.obscuresBackgroundDuringPres

我使用的UISearchController和结果控制器将是相同的

 searchController = UISearchController(searchResultsController: nil)
    searchController?.searchResultsUpdater = self
    searchController?.searchBar.delegate = self
   searchController?.obscuresBackgroundDuringPresentation = true
//这将允许用户在搜索处于活动状态时无法与tableview交互


正如我已经告诉过的,如果用户搜索某个内容,我将在同一个视图控制器中显示结果,因此当搜索开始时,“文本确实发生了变化”,我想禁用此行为。如何实现这一点?

如果搜索栏文本长度大于0,则tableview的UserInAction应为false