Skip to content

Instantly share code, notes, and snippets.

@seanhess
Created April 15, 2013 15:56
Show Gist options
  • Save seanhess/5389145 to your computer and use it in GitHub Desktop.
Save seanhess/5389145 to your computer and use it in GitHub Desktop.
// I had to set the navigation bar to hidden, then add the top and bottom controls as a view.
// I don't think you can control the navigation bar directly.
- (void)viewDidLoad {
[self.navigationController setNavigationBarHidden:YES animated:NO];
}
- (void)showControls {
[UIView animateWithDuration:0.2 animations:^{
CGRect bottomFrame = self.bottomControlsView.frame;
bottomFrame.origin.y = self.view.frame.size.height - bottomFrame.size.height;
self.bottomControlsView.frame = bottomFrame;
CGRect topFrame = self.topControlsView.frame;
topFrame.origin.y = 0;
self.topControlsView.frame = topFrame;
}];
}
- (void)hideControls {
[UIView animateWithDuration:0.2 animations:^{
CGRect bottomFrame = self.bottomControlsView.frame;
bottomFrame.origin.y = self.view.frame.size.height;
self.bottomControlsView.frame = bottomFrame;
CGRect topFrame = self.topControlsView.frame;
topFrame.origin.y = -topFrame.size.height;
self.topControlsView.frame = topFrame;
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment