I have a UISearchBar that has a cancel button (it\'s displayed using -(void)setShowsCancelButton:animated). I\'ve changed the tintColor of the sear
-(void)setShowsCancelButton:animated
tintColor
For iOS 11 and Swift 4. Create a subclass of UISearchController. Override method:
override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() print("layout") if let btn = searchBar.subviews[0].subviews[2] as? UIButton { btn.frame = CGRect(x: 306, y: 20, width: 53, height: 30) } }