Created
October 26, 2015 16:07
-
-
Save TimothyChilvers/3e7c9fa756fac8b3a486 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
- (void)moveStuff { | |
CGRect originalFrame = self.moveMe.frame; | |
CGAffineTransform firstTransform = CGAffineTransformMake(0, 1, -1, 0, -50, -50); | |
[UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ | |
self.moveMe.transform = firstTransform; | |
} completion:^(BOOL finished) { | |
CGRect stashFrame = self.moveMe.frame; | |
self.moveMe.transform = CGAffineTransformIdentity; | |
self.moveMe.frame = stashFrame; | |
[UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ | |
CGAffineTransform secondTransform = CGAffineTransformMakeTranslation(0, 50); | |
self.moveMe.transform = secondTransform; | |
} completion:^(BOOL finished) { | |
self.moveMe.transform = CGAffineTransformIdentity; | |
self.moveMe.frame = originalFrame; | |
}]; | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment