Skip to content

Commit

Permalink
Merge pull request #52 from iosphere/fix/handle-animation
Browse files Browse the repository at this point in the history
Fix non-animated handle state changes
  • Loading branch information
Hagi authored Jun 1, 2017
2 parents 81f0533 + 3a1a22e commit 3918617
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions ISHPullUp/ISHPullUpHandleView.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,14 @@ - (void)setState:(ISHPullUpHandleState)state animated:(BOOL)animated {

_state = state;

if (!animated) {
[self setNeedsLayout];
return;
}

UIBezierPath *newPath = [self pathForBounds:self.bounds state:state];

NSString *keyPath = @"path";
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:keyPath];
animation.fromValue = (id)self.shapeLayer.path;
self.shapeLayer.path = [newPath CGPath];
animation.toValue = (id)self.shapeLayer.path;
animation.duration = 0.35;
animation.duration = animated ? 0.35 : 0.0;
[self.shapeLayer addAnimation:animation forKey:keyPath];
}

Expand Down

0 comments on commit 3918617

Please sign in to comment.