Created
March 13, 2013 01:16
-
-
Save nomatteus/5148606 to your computer and use it in GitHub Desktop.
Code to animate a search bar out of view after a few seconds.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ANIMATE SEARCH BAR AWAY | |
// This code is in a table view class. | |
// Idea was to show the search bar, to let the user know it exists, then animate it away after a couple seconds. | |
// This code works great, but I took the feature out, and just showed the search bar persistently. | |
- (void)setupSearchBar { | |
// Hide search bar after a couple seconds, to let user know it's there. | |
[self performSelector:@selector(animateHideSearchBar) withObject:nil afterDelay:2.5]; | |
} | |
- (void)animateHideSearchBar { | |
// Scroll table view so search bar is just out of sight | |
CGPoint offset = CGPointMake(0, self.searchBar.frame.size.height); | |
[self.tableView setContentOffset:offset animated:YES]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Paul I was just looking at some code of your on a site (involving CSS), then I posted to myself a CURL Gist and now see you again here, having just posted a Gist.
It's a very small world.