Keyboard hide on click of UISearchBar in iOS v12.2+ in iPad Pro

When I click on the UISearchBar keyboard is popping up and get hide automatically. It calls the Endditing delegate of UISearchBar automatically without pressing return or enters key from keypad. The same scenario is not happing when I am running an app on iOS v10.2 in iPad air. I am using xcode 10+.

inspite of when I am building the same app from the lower version xcode 8+ keypad is not getting hide when clicking on UISearchBar.


Your helpful suggestion will gratefull to me. Thanks in advance for your valuable response to my query.


Code:


-(BOOL)searchBarShouldBeginEditing:(UISearchBar*)searchBar

{

[[KeyboardHideShow getInstance] setScrollRectToThisFrame:[searchBar convertRect:searchBar.frame toView:self.scrollView]];

if(!self->_normalSearchPopOverController)

{

[[KeyboardHideShow getInstance] setUp_With_ScrollView:nil];

//Table view created to auto-populate search result list in popover controller

[self setTableViewController:[[UITableViewController alloc] initWithStyle:UITableViewStylePlain]];

[self->_tableViewController.tableView setDelegate:self];

[self->_tableViewController.tableView setDataSource:self];

//To add the transparent view

[self addTransparentView_For_NormalSearch_And_AdvancedSearch];

//To present the Popovercontroller with table view controller

[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;

}