Skip to content

Instantly share code, notes, and snippets.

@yaakovgamliel
Last active August 29, 2015 14:16
Show Gist options
  • Save yaakovgamliel/3a36d366f329d9d6ace1 to your computer and use it in GitHub Desktop.
Save yaakovgamliel/3a36d366f329d9d6ace1 to your computer and use it in GitHub Desktop.
#define SWIZZLE_ADD_ANIMATION 0
#if DEBUG && SWIZZLE_ADD_ANIMATION
+ (void)load {
safe_swap_implementation(self, @selector(addAnimation:forKey:), @selector(bb_addAnimation:forKey:));
}
- (void)bb_addAnimation:(CAAnimation *)animation forKey:(NSString *)key {
// Ignore the stupid phantom text field's cursor animation
if ([[[self delegate] superview] isKindOfClass:NSClassFromString(@"UITextSelectionView")] == NO) {
NSLog(@"Key: %@, Animation: %@, Layer: %@", key, [animation debugDescription], [self debugDescription]);
}
[self bb_addAnimation:animation forKey:key];
// if ([animation isKindOfClass:[CATransition class]]) {
// NSLog(@"STOP IN THE NAME OF CORE ANIMATION!");
// }
//
// if ([key isEqualToString:@"contents"]) {
// NSLog(@"STOP IN THE NAME OF CORE ANIMATION!");
// }
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment