In iOS 7.x we were able to use
[[UITextField appearanceWhenContainedIn:[UISearchBar class], nil]
setDefaultTextAttributes:@{NSForegroundColorAttributeName:myColor}];
But it got deprecated in iOS 9. The only solution I know - is to iterate through subview hierarchy of UISearchBar
, look for UITextField
and change its properties. But this way is considered as Private API Usage
Do we have legal way to change UISearchBar text color in iOS 9.x?