Created
April 22, 2016 09:18
-
-
Save nthState/dd63694681f36895d1050b5395187e6d to your computer and use it in GitHub Desktop.
Quadratic UIView animation
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
self.topConstraint.constant = 0.0 | |
UIView.animateWithDuration(2, delay: 1, options: UIViewAnimationOptions.CurveEaseInOut, animations: { | |
CATransaction.begin() | |
CATransaction.setValue(2, forKey: "kCATransactionAnimationDuration") | |
let f = CAMediaTimingFunction(controlPoints: 0.43, 0, 0.57, 1) //quad ease in out | |
CATransaction.setAnimationTimingFunction(f) | |
self.view.layoutIfNeeded() | |
CATransaction.commit() | |
}, completion: { (complete:Bool) in | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment