Last active
September 11, 2017 08:35
-
-
Save matt-curtis/6b9235f3a3e94ce9145d to your computer and use it in GitHub Desktop.
Disable animation in UINavigationBar
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
@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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This seems to break in iOS 11.x. Did you figure out a way to make it work?