How can I programmatically force a search in the UISearchBar?

后端 未结 8 1209
遥遥无期
遥遥无期 2021-02-05 05:15

How can I force the UISearchBar to automatically start a new search (like pressing the Search button)? Is there an easy way to achieve this?

8条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-05 06:17

    seems dumb, but works, so it's not dumb ;)

    NSString * forceReload = self.searchDisplayController.searchBar.text;
    self.searchDisplayController.searchBar.text = forceReload;
    

提交回复
热议问题