I need to set my custom inputView in UISearchBar.
So i wrote following codes , that is working perfectly in iOS5 and iOS6 .
However it doesn't work in iOS7.
for(int i =0; i<[self.searchBar.subviews count]; i++) {
if([[self.searchBar.subviews objectAtIndex:i] isKindOfClass:[UITextField class]])
{
[(UITextField*)[searchBar.subviews objectAtIndex:i] setFont:[UIFont fontWithName:@"MyCustomFont" size:15]];
UITextField* search=(UITextField*)[searchBar.subviews objectAtIndex:i];
search.delegate = self;
[(UITextField*)[self.searchBar.subviews objectAtIndex:i] setInputView:self.customKeyboard];
[self.customKeyboard setTextView:search];
}
}
[self.sBar reloadInputViews];
How can i do that?