How to change the default text of Cancel Button which appears in the UISearchBar +iPhone

后端 未结 15 2022
慢半拍i
慢半拍i 2020-12-01 03:04

I am developing an Application where I wanted to change the text of Search String in the SearchBar. I wanted to change the text of Cancel Button Also which appears next to t

15条回答
  •  醉酒成梦
    2020-12-01 03:43

        if #available(iOS 13.0, *) {
            controller.searchBar.setValue("Done", forKey:"cancelButtonText")
        } else {
            controller.searchBar.setValue("Done", forKey:"_cancelButtonText")
        }
    

提交回复
热议问题