Hi team,
I am calling UISearchBar control for search then it presents the table view controller inside the UIPopovercontroller but as soon as it calls the ShouldBeginEditing delegate callback of UiSearchBar then it Automatically the ShouldEndEditing Delegate callback of UiSearchBar control.
The above scenario is happening with Xcode 10 + version. The same scenario is not happening with Xcode 8 version. Please find below the code and guide me where I am wrong. Thanks for Help.
Code:
-(BOOL)searchBarShouldBeginEditing:(UISearchBar*)searchBar
{
if([searchBar isEqual:_normalSearch_SearchBar])
{
[[KeyboardHideShow getInstance] setScrollRectToThisFrame:[searchBar convertRect:searchBar.frame toView:self.scrollView]];
if(!self->_normalSearchPopOverController)
{
[[KeyboardHideShow getInstance] setUp_With_ScrollView:nil];
[self setTableViewController:[[UITableViewController alloc] initWithStyle:UITableViewStylePlain]];
[self->_tableViewController.tableView setDelegate:self];
[self->_tableViewController.tableView setDataSource:self];
[self addTransparentView_For_NormalSearch_And_AdvancedSearch];
//To add the transparent view
[self setNormalSearchPopOverController:[[UIPopoverController alloc] initWithContentViewController:self->_tableViewController]];
[self->_normalSearchPopOverController setDelegate:self];
[self->_normalSearchPopOverController setPopoverContentSize:CGSizeMake(POPOVERWIDTH,350)];
[self->_normalSearchPopOverController presentPopoverFromBarButtonItem:self->_searchBarButtonItem permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
return YES;
}
}
return NO;
}