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

Commit

Permalink
Don't animate system views with the animator. (#119)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
jverkoey authored Mar 8, 2018
1 parent d2f5971 commit c805783
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
4 changes: 1 addition & 3 deletions examples/CalendarCardExpansionExample.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 0 additions & 2 deletions examples/CalendarChipMotionSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions examples/CalendarChipMotionSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c805783

Please sign in to comment.