From c8057832a9f961585978d59a7ea03e8f641d8ae6 Mon Sep 17 00:00:00 2001 From: featherless Date: Thu, 8 Mar 2018 09:07:47 -0500 Subject: [PATCH] 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. --- examples/CalendarCardExpansionExample.m | 4 +--- examples/CalendarChipMotionSpec.h | 2 -- examples/CalendarChipMotionSpec.m | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/examples/CalendarCardExpansionExample.m b/examples/CalendarCardExpansionExample.m index 3648e49..ae9edd8 100644 --- a/examples/CalendarCardExpansionExample.m +++ b/examples/CalendarCardExpansionExample.m @@ -48,9 +48,7 @@ - (void)didTap { animator.shouldReverseValues = !_expanded; animator.beginFromCurrentState = YES; - [animator animateWithTraits:traits.navigationBarY animations:^{ - [self.navigationController setNavigationBarHidden:_expanded animated:YES]; - }]; + [self.navigationController setNavigationBarHidden:_expanded animated:YES]; CGRect chipFrame = [self frameForChip]; CGRect headerFrame = [self frameForHeader]; diff --git a/examples/CalendarChipMotionSpec.h b/examples/CalendarChipMotionSpec.h index d7989f2..21a9d21 100644 --- a/examples/CalendarChipMotionSpec.h +++ b/examples/CalendarChipMotionSpec.h @@ -26,8 +26,6 @@ @property(nonatomic, strong, nonnull, readonly) MDMAnimationTraits *chipContentOpacity; @property(nonatomic, strong, nonnull, readonly) MDMAnimationTraits *headerContentOpacity; -@property(nonatomic, strong, nonnull, readonly) MDMAnimationTraits *navigationBarY; - @end @interface CalendarChipMotionSpec: NSObject diff --git a/examples/CalendarChipMotionSpec.m b/examples/CalendarChipMotionSpec.m index 51bffc3..567e9ea 100644 --- a/examples/CalendarChipMotionSpec.m +++ b/examples/CalendarChipMotionSpec.m @@ -80,10 +80,6 @@ - (MDMAnimationTraits *)headerContentOpacity { return [[MDMAnimationTraits alloc] initWithDelay:0.000 duration:0.075 timingCurve:LinearTimingCurve()]; } -- (MDMAnimationTraits *)navigationBarY { - return [[MDMAnimationTraits alloc] initWithDelay:0.045 duration:0.150 timingCurve:StandardTimingCurve()]; -} - @end @implementation CalendarChipMotionSpec