I've got a UISearchBar in my UINavigationItem's titleView associated with a UISearchController. When I navigate back, it appears to flash. Anyone seen this before?
@interface HNTileSearchViewController () <HNTileSearchResultsProtocol, SWRevealViewControllerDelegate, UISearchBarDelegate, HNSetSearchFiltersProtocol, HNKeywordResultsProtocol>
...
@property (nonatomic, strong) UISearchController *searchController;
@property (nonatomic, strong) UISearchBar * searchBarTop;
...
@end
@implementation HNTileSearchViewController
...
- (void) customPreSetup {
HNKeywordResultsTableViewController * searchResultsController = [self.storyboard instantiateViewControllerWithIdentifier:HNKeywordResultsTableViewControllerStoryboardIdentifier];
searchResultsController.delegate = self;
_searchController = [[UISearchController alloc] initWithSearchResultsController:searchResultsController];
_searchController.searchResultsUpdater = searchResultsController;
_searchController.hidesNavigationBarDuringPresentation = NO;
_searchController.dimsBackgroundDuringPresentation = NO;
_searchBarTop = _searchController.searchBar;
_searchBarTop.delegate = self;
_searchBarTop.placeholder = NSLocalizedString(@"Search heynay", nil);
_searchBarTop.showsCancelButton = NO;
_searchBarTop.showsScopeBar = NO;
self.navigationItem.titleView = _searchBarTop;
self.definesPresentationContext = YES;
}
- (void) viewDidLoad {
[super viewDidLoad];
[self customPreSetup];
...
}
....
@end
_searchController.searchBar.barTintColor= [HN_APP_DELEGATE brandColor];
– Sankaran