How can I change the font size of UISearchBar ?
If you need a convenient way to change all your application searchbars, here's a simple subclass in Swift 5:
class MySearchBar: UISearchBar {
override func layoutSubviews() {
super.layoutSubviews()
if let textFieldInsideSearchBar = value(forKey: "searchField") as? UITextField {
textFieldInsideSearchBar.font = UIFont(name: "Oswald-Light", size: 14)
}
}
}