I am trying to accomplish the same look of my UISearchBar with a TextField within it, as in my iOS 6 app. I have tried to code it in several ways and not yet been successful
iOS6 & iOS7 compatible solution:
- (void)setTextFieldAsDelegate:(UIView *)inputView {
for (UIView *view in inputView.subviews) {
if ([view isKindOfClass:[UITextField class]]) {
searchBarTextField = (UITextField *)view;
searchBarTextField.delegate = self;
break;
} else {
[self setTextFieldAsDelegate:view];
}
}
}