ios 中searchBar进入界面立即聚焦处理方式
开发中可能会碰到调用第一响应者[self.searchController.searchBar becomeFirstResponder]无效;
解决方法:
#pragma mark UISearchControllerDelegate
- (void)didPresentSearchController:(UISearchController *)searchController {
[UIView animateWithDuration:0.1 animations:^{} completion:^(BOOL finished) {
[self.searchController.searchBar becomeFirstResponder];
}];
}
iOS 10.2之后可能直接掉用方法无效