I\'m trying to hide the Cancel button of the search bar in the UISearchController, but unfortunately setting the following in viewDidLoad() does not work:
ov
Try subclassing UISearchBar and implement:
UISearchBar
override func layoutSubviews() { super.layoutSubviews() self.setShowsCancelButton(false, animated: false) }
This SO thread may help you more in this direction.