ios-horizontalmenu/Sources/AnimationDynamics.swift

23 lines
1010 B
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// AnimationDynamics.swift
// TPGHorizontalMenu
//
// Created by David Livadaru on 22/03/2017.
// Copyright © 2017 3Pillar Global. All rights reserved.
//
import Foundation
/// An abstraction for dynamics which can be used with an animation.
public struct AnimationDynamics {
/// The damping ratio for the spring animation as it approaches its quiescent state.
/// To smoothly decelerate the animation without oscillation, use a value of 1. Employ a damping ratio closer to zero to increase oscillation
public let dampingRatio: CGFloat
/// The initial spring velocity. For smooth start to the animation, match this value to the views velocity as it was prior to attachment.
///
/// A value of 1 corresponds to the total animation distance traversed in one second.
///
/// For example, if the total animation distance is 200 points and you want the start of the animation to match a view velocity of 100 pt/s, use a value of 0.5.
public let velocity: CGFloat
}