Skip to content

Instantly share code, notes, and snippets.

@jeffleeismyhero
Created August 7, 2016 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffleeismyhero/14c959425e73ead29bfb4b5b67c8bcca to your computer and use it in GitHub Desktop.
Save jeffleeismyhero/14c959425e73ead29bfb4b5b67c8bcca to your computer and use it in GitHub Desktop.
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
[searchBar resignFirstResponder];
[UIView animateWithDuration:0.01f animations:^{
self.searchController.searchBar.alpha = 0.0;
} completion:^(BOOL finished) {
[self.tableView setContentOffset:CGPointMake(0, self.tableView.contentOffset.y + self.searchController.searchBar.frame.size.height)];
[UIView animateWithDuration:1.0f animations:^ {
self.searchController.searchBar.alpha = 1.0;
}];
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment