I'm using UITextField
as a UISearchBar
replacement and "stealing" the magnifying glass icon from the original UISearchBar
with this crazy code:
UISearchBar *originalSearchBar = [[UISearchBar alloc] init];
for (UIView *searchBarSubview in [originalSearchBar subviews]) {
if([searchBarSubview isKindOfClass:[UITextField class]]) {
UITextField *textField = (UITextField *)searchBarSubview;
[_textField setLeftView:[textField leftView]];
[_textField setLeftViewMode:UITextFieldViewModeAlways];
}
}
As you've probably guessed, I don't want to use my own bitmap.
Isn't there an easier accessible magnifying glass icon somewhere in Cocoa?