Created
February 10, 2018 10:57
-
-
Save muukii/f79d44b13db2a2004ac091352a3c0b04 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
import UIKit | |
// http://easings.net/ | |
@available(iOS 10.0, *) | |
extension UICubicTimingParameters { | |
public class func easeInSine() -> UICubicTimingParameters { return UICubicTimingParameters(0.47, 0, 0.745, 0.715) } | |
public class func easeOutSine() -> UICubicTimingParameters { return UICubicTimingParameters(0.39, 0.575, 0.565, 1) } | |
public class func easeInOutSine() -> UICubicTimingParameters { return UICubicTimingParameters(0.445, 0.05, 0.55, 0.95) } | |
public class func easeInQuad() -> UICubicTimingParameters { return UICubicTimingParameters(0.55, 0.085, 0.68, 0.53) } | |
public class func easeOutQuad() -> UICubicTimingParameters { return UICubicTimingParameters(0.25, 0.46, 0.45, 0.94) } | |
public class func easeInOutQuad() -> UICubicTimingParameters { return UICubicTimingParameters(0.455, 0.03, 0.515, 0.955) } | |
public class func easeInCubic() -> UICubicTimingParameters { return UICubicTimingParameters(0.55, 0.055, 0.675, 0.19) } | |
public class func easeOutCubic() -> UICubicTimingParameters { return UICubicTimingParameters(0.215, 0.61, 0.355, 1) } | |
public class func easeInOutCubic() -> UICubicTimingParameters { return UICubicTimingParameters(0.645, 0.045, 0.355, 1) } | |
public class func easeInQuart() -> UICubicTimingParameters { return UICubicTimingParameters(0.895, 0.03, 0.685, 0.22) } | |
public class func easeOutQuart() -> UICubicTimingParameters { return UICubicTimingParameters(0.165, 0.84, 0.44, 1) } | |
public class func easeInOutQuart() -> UICubicTimingParameters { return UICubicTimingParameters(0.77, 0, 0.175, 1) } | |
public class func easeInQuint() -> UICubicTimingParameters { return UICubicTimingParameters(0.755, 0.05, 0.855, 0.06) } | |
public class func easeOutQuint() -> UICubicTimingParameters { return UICubicTimingParameters(0.23, 1, 0.32, 1) } | |
public class func easeInOutQuint() -> UICubicTimingParameters { return UICubicTimingParameters(0.86, 0, 0.07, 1) } | |
public class func easeInExpo() -> UICubicTimingParameters { return UICubicTimingParameters(0.95, 0.05, 0.795, 0.035) } | |
public class func easeOutExpo() -> UICubicTimingParameters { return UICubicTimingParameters(0.19, 1, 0.22, 1) } | |
public class func easeInOutExpo() -> UICubicTimingParameters { return UICubicTimingParameters(1, 0, 0, 1) } | |
public class func easeInCirc() -> UICubicTimingParameters { return UICubicTimingParameters(0.6, 0.04, 0.98, 0.335) } | |
public class func easeOutCirc() -> UICubicTimingParameters { return UICubicTimingParameters(0.075, 0.82, 0.165, 1) } | |
public class func easeInOutCirc() -> UICubicTimingParameters { return UICubicTimingParameters(0.785, 0.135, 0.15, 0.86) } | |
public class func easeInBack() -> UICubicTimingParameters { return UICubicTimingParameters(0.6, -0.28, 0.735, 0.045) } | |
public class func easeOutBack() -> UICubicTimingParameters { return UICubicTimingParameters(0.175, 0.885, 0.32, 1.275) } | |
public class func easeInOutBack() -> UICubicTimingParameters { return UICubicTimingParameters(0.68, -0.55, 0.265, 1.55) } | |
private convenience init(_ x1: CGFloat, _ y1: CGFloat, _ x2: CGFloat, _ y2: CGFloat) { | |
self.init(controlPoint1: .init(x: x1, y: y1), controlPoint2: .init(x: x2, y: y2)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment