Created
August 27, 2014 11:28
-
-
Save marcpalmer/6eb3b6c6e9cef5fd0a8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BOOL hasCurrentAnimations = [self.myLabel.layer animationKeys].count; | |
if (rising) { | |
[self.currentTimeLabel.layer removeAllAnimations]; | |
[UIView animateWithDuration:5.0f delay:0.0f | |
options:(hasCurrentAnimations ? UIViewAnimationOptionBeginFromCurrentState : 0) animations:^{ | |
self.myLabel.center = CGPointMake(self.myLabel.center.x, self.otherButton.center.y); | |
} completion:nil]; | |
} else { | |
[self.currentTimeLabel.layer removeAllAnimations]; | |
[UIView animateWithDuration:5.0f delay:0.0f | |
options:(hasCurrentTransformAnimation ? UIViewAnimationOptionBeginFromCurrentState : 0) animations:^{ | |
self.myLabel.center = CGPointMake(self.myLabel.center.x, originalLabelY); | |
} completion:nil]; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment