Last active
October 18, 2019 20:13
-
-
Save saru2020/b3fb36847a0f447be8e218c881b68d82 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
UIView.animateKeyframes(withDuration: 5, //1 | |
delay: 0, //2 | |
options: .calculationModeLinear, //3 | |
animations: { //4 | |
UIView.addKeyframe( //5 | |
withRelativeStartTime: 0.25, //6 | |
relativeDuration: 0.25) { //7 | |
self.button.center = CGPoint(x: self.view.bounds.midX, y: self.view.bounds.maxY) //8 | |
} | |
UIView.addKeyframe(withRelativeStartTime: 0.5, relativeDuration: 0.25) { | |
self.button.center = CGPoint(x: self.view.bounds.width, y: start.y) | |
} | |
UIView.addKeyframe(withRelativeStartTime: 0.75, relativeDuration: 0.25) { | |
self.button.center = start | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment