Skip to content

Instantly share code, notes, and snippets.

@matt-curtis
Last active September 11, 2017 08:35
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matt-curtis/6b9235f3a3e94ce9145d to your computer and use it in GitHub Desktop.
Save matt-curtis/6b9235f3a3e94ce9145d to your computer and use it in GitHub Desktop.
Disable animation in UINavigationBar
@implementation MyNavBar
- (NSArray*) subviews {
NSArray *subviews = [super subviews];
if(_animationDisabled) [self removeAllAnimationsInViews:subviews];
return subviews;
}
- (void) removeAllAnimationsInViews:(NSArray*)views {
for (UIView *view in views){
[view.layer removeAllAnimations];
if(view.subviews.count > 0){
[self removeAllAnimationsInViews:view.subviews];
}
}
}
@end
@iGriever
Copy link

This seems to break in iOS 11.x. Did you figure out a way to make it work?

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