Skip to content

Commit 155e1ab

Browse files
author
wuxingchen
committed
update api
1 parent af9bdc7 commit 155e1ab

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Sources/PopupUI/PopupAnimation.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class PopupAnimation {
1111

1212
public static var `default` = PopupAnimation(.center, .spring(response: 0.4, dampingFraction: 0.7, blendDuration: 0.35))
1313

14-
public let position: PopupPosition
14+
public var position: PopupPosition
1515

1616
public var animation: Animation
1717

@@ -25,6 +25,20 @@ public class PopupAnimation {
2525

2626
}
2727

28+
extension PopupAnimation {
29+
@discardableResult
30+
public func position(_ position: PopupPosition) -> PopupAnimation {
31+
self.position = position
32+
return self
33+
}
34+
35+
@discardableResult
36+
public func animation(_ animation: Animation) -> PopupAnimation {
37+
self.animation = animation
38+
return self
39+
}
40+
}
41+
2842
extension Animation {
2943
var duration: TimeInterval {
3044
TimeInterval(description.components(separatedBy: ",").first(where: { $0.contains("duration") })?.components(separatedBy: "duration: ").last ??

0 commit comments

Comments
 (0)