Skip to content

Commit 0ffeb89

Browse files
authored
Fix alongside animators (#60)
1 parent 1c7e9bc commit 0ffeb89

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Rideau/Core/RideauHostingView.swift

+7-8
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ final class RideauHostingView: RideauTouchThroughView {
310310
let newresolvedState = resolve(configuration: self.configuration)
311311
resolvedState = newresolvedState
312312

313+
hasTakenAlongsideAnimators = false
314+
prepareAlongsideAnimators()
315+
313316
if let initial = newresolvedState.resolvedSnapPoints.last {
314317
updateLayout(target: initial, resolvedState: newresolvedState)
315318
} else {
@@ -333,8 +336,12 @@ final class RideauHostingView: RideauTouchThroughView {
333336
// It had to update layout, but configuration for layot does not have changes.
334337
return
335338
}
339+
336340
resolvedState = newresolvedState
337341

342+
hasTakenAlongsideAnimators = false
343+
prepareAlongsideAnimators()
344+
338345
guard
339346
let snapPoint = newresolvedState.resolvedSnapPoint(by: currentSnapPoint.source) ?? newresolvedState.resolvedSnapPoints.first
340347
else {
@@ -355,10 +362,6 @@ final class RideauHostingView: RideauTouchThroughView {
355362

356363
preventCurrentAnimations: do {
357364

358-
if #available(iOS 11, *) {
359-
prepareAlongsideAnimators()
360-
}
361-
362365
animatorStore.allAnimators()
363366
.forEach {
364367
$0.pauseAnimation()
@@ -486,10 +489,6 @@ final class RideauHostingView: RideauTouchThroughView {
486489
containerDraggingAnimator?.pauseAnimation()
487490
containerDraggingAnimator?.stopAnimation(true)
488491

489-
if #available(iOS 11, *) {
490-
prepareAlongsideAnimators()
491-
}
492-
493492
let targetScrollView: UIScrollView? = {
494493

495494
guard let gesture = gesture as? RideauViewDragGestureRecognizer else {

0 commit comments

Comments
 (0)