Skip to content

Commit bc2039d

Browse files
author
Olga Konoreva
committed
Fix customization spring animation parameters issue
1 parent 1b24388 commit bc2039d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Sources/MenuAnimator.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ public struct TransitionOptions {
109109
public struct SpringSettings {
110110
let presentSpringParams: SpringParams
111111
let dismissSpringParams: SpringParams
112+
113+
public init(presentSpringParams: SpringParams, dismissSpringParams: SpringParams) {
114+
self.presentSpringParams = presentSpringParams
115+
self.dismissSpringParams = dismissSpringParams
116+
}
112117
}
113118

114119
/**
@@ -121,6 +126,11 @@ public struct SpringParams {
121126

122127
/// The initial spring velocity. For smooth start to the animation, match this value to the view’s velocity.
123128
let velocity: CGFloat
129+
130+
public init(dampingRatio: CGFloat, velocity: CGFloat) {
131+
self.dampingRatio = dampingRatio
132+
self.velocity = velocity
133+
}
124134
}
125135

126136
/**

0 commit comments

Comments
 (0)