There are older version of this question for older versions of iOS no longer works due to the layout changes in UISearchBar.
I've tried the following to completely remove the background color of UISearchBar but it doesn't work. (I tried to look up the hierarchy views of it but xCode kept crashing for this option.)
private func clearBackgroundColor() {
for view in self.subviews {
view.backgroundColor = UIColor.clear
for subview in view.subviews {
subview.backgroundColor = UIColor.clear
}
}
}
Any ideas or suggestions?
Thanks!!
ViewDidLayoutSubviews()
? – Iridis