Skip to content

Commit

Permalink
Merge pull request #68 from cashapp/clo/in-progress-property-for-anim…
Browse files Browse the repository at this point in the history
…ation-queue

Add inProgressAnimation property to AnimationQueue
  • Loading branch information
NickEntin committed Mar 1, 2023
2 parents 1444e2b + 8cd5520 commit 69dcc4c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Sources/Stagehand/AnimationQueue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ public final class AnimationQueue<ElementType: AnyObject> {
self.element = element
}

// MARK: - Public Properties

public var hasInProgressAnimation: Bool {
guard let currentAnimation = queue.first else {
return false
}

switch currentAnimation.instance.status {
case .pending, .animating:
return true
case .complete, .canceled:
return false
}
}

// MARK: - Private Properties

private let element: ElementType
Expand Down

0 comments on commit 69dcc4c

Please sign in to comment.