Camera and editor improvements

This commit is contained in:
Ilya Laktyushin
2023-05-31 15:24:07 +04:00
parent 9bd6dd35c7
commit 2b85ec7b5f
17 changed files with 372 additions and 160 deletions

View File

@@ -21,11 +21,13 @@ public final class LottieAnimationComponent: Component {
public var name: String
public var mode: Mode
public var range: (CGFloat, CGFloat)?
public var waitForCompletion: Bool
public init(name: String, mode: Mode, range: (CGFloat, CGFloat)? = nil) {
public init(name: String, mode: Mode, range: (CGFloat, CGFloat)? = nil, waitForCompletion: Bool = true) {
self.name = name
self.mode = mode
self.range = range
self.waitForCompletion = waitForCompletion
}
public static func == (lhs: LottieAnimationComponent.AnimationItem, rhs: LottieAnimationComponent.AnimationItem) -> Bool {
@@ -157,7 +159,7 @@ public final class LottieAnimationComponent: Component {
}
}
if let animationView = self.animationView, animationView.isAnimationPlaying {
if let animationView = self.animationView, animationView.isAnimationPlaying && component.animation.waitForCompletion {
updateComponent = false
self.currentCompletion = { [weak self] in
guard let strongSelf = self else {