Skip to content

Instantly share code, notes, and snippets.

@tomazsh
Created December 11, 2012 09:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomazsh/4257206 to your computer and use it in GitHub Desktop.
Save tomazsh/4257206 to your computer and use it in GitHub Desktop.
Moving navigation bar in UINavigationController along with UIScrollView
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CALayer *layer = self.navigationController.navigationBar.layer;
CGFloat y = scrollView.contentOffset.y+scrollView.contentInset.top;
if (y >= 0.0f) {
layer.transform = CATransform3DMakeTranslation(0.0f, -y, 0.0f);
} else {
layer.transform = CATransform3DIdentity;
}
}
@tomazsh
Copy link
Author

tomazsh commented Nov 9, 2020

if (a) {
print(a)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment