Skip to content

Instantly share code, notes, and snippets.

@brimelow
Created June 16, 2019 04:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brimelow/3b941f188a272f65f5bc8a1ffedcb568 to your computer and use it in GitHub Desktop.
Save brimelow/3b941f188a272f65f5bc8a1ffedcb568 to your computer and use it in GitHub Desktop.
SwiftUI Animation Easing Extension
//
// EasingEquations.swift
// DrawingGroup
//
// Created by Lee Brimelow on 6/15/19.
// Copyright © 2019 Lee Brimelow. All rights reserved.
//
import SwiftUI
public extension BasicAnimationTimingCurve {
static var easeInCirc: BasicAnimationTimingCurve {
return .custom(0.600, 0.040, 0.980, 0.335)
}
static var easeInExpo: BasicAnimationTimingCurve {
return .custom(0.950, 0.050, 0.795, 0.035)
}
static var easeInQuart: BasicAnimationTimingCurve {
return .custom(0.895, 0.030, 0.685, 0.220)
}
static var easeInQuint: BasicAnimationTimingCurve {
return .custom(0.755, 0.050, 0.855, 0.060)
}
static var easeInOutCirc: BasicAnimationTimingCurve {
return .custom(0.785, 0.135, 0.150, 0.860)
}
static var easeInOutExpo: BasicAnimationTimingCurve {
return .custom(1.000, 0.000, 0.000, 1.000)
}
static var easeInOutQuart: BasicAnimationTimingCurve {
return .custom(0.770, 0.000, 0.175, 1.000)
}
static var easeInOutQuint: BasicAnimationTimingCurve {
return .custom(0.860, 0.000, 0.070, 1.000)
}
static var easeOutCirc: BasicAnimationTimingCurve {
return .custom(0.075, 0.820, 0.165, 1.000)
}
static var easeOutExpo: BasicAnimationTimingCurve {
return .custom(0.190, 1.000, 0.220, 1.000)
}
static var easeOutQuart: BasicAnimationTimingCurve {
return .custom(0.165, 0.840, 0.440, 1.000)
}
static var easeOutQuint: BasicAnimationTimingCurve {
return .custom(0.230, 1.000, 0.320, 1.000)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment