Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Commit c805783

Browse files
authored
Don't animate system views with the animator. (#119)
* Don't animate system views with the animator. Notably, animating the status bar with the animator can cause all of the status bar elements to animate. This is not desirable and deviant from UIKit's implicit animator behavior, but at this time I don't see a way to mimic the same behavior without regressing on our support for animating unhosted layers. * Remove unused spec item.
1 parent d2f5971 commit c805783

3 files changed

+1
-9
lines changed

examples/CalendarCardExpansionExample.m

+1-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ - (void)didTap {
4848
animator.shouldReverseValues = !_expanded;
4949
animator.beginFromCurrentState = YES;
5050

51-
[animator animateWithTraits:traits.navigationBarY animations:^{
52-
[self.navigationController setNavigationBarHidden:_expanded animated:YES];
53-
}];
51+
[self.navigationController setNavigationBarHidden:_expanded animated:YES];
5452

5553
CGRect chipFrame = [self frameForChip];
5654
CGRect headerFrame = [self frameForHeader];

examples/CalendarChipMotionSpec.h

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
@property(nonatomic, strong, nonnull, readonly) MDMAnimationTraits *chipContentOpacity;
2727
@property(nonatomic, strong, nonnull, readonly) MDMAnimationTraits *headerContentOpacity;
2828

29-
@property(nonatomic, strong, nonnull, readonly) MDMAnimationTraits *navigationBarY;
30-
3129
@end
3230

3331
@interface CalendarChipMotionSpec: NSObject

examples/CalendarChipMotionSpec.m

-4
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ - (MDMAnimationTraits *)headerContentOpacity {
8080
return [[MDMAnimationTraits alloc] initWithDelay:0.000 duration:0.075 timingCurve:LinearTimingCurve()];
8181
}
8282

83-
- (MDMAnimationTraits *)navigationBarY {
84-
return [[MDMAnimationTraits alloc] initWithDelay:0.045 duration:0.150 timingCurve:StandardTimingCurve()];
85-
}
86-
8783
@end
8884

8985
@implementation CalendarChipMotionSpec

0 commit comments

Comments
 (0)