Skip to content

Commit 9476ddf

Browse files
authored
Fix bug where user could make a view come back from hidden state, resulting in a bad UI state. (#54)
1 parent c53af50 commit 9476ddf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Rideau/RideauHostingView.swift

+6-2
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ final class RideauHostingView: RideauTouchThroughView {
106106

107107
private var isInteracting: Bool = false
108108

109+
private var isTerminated: Bool = false
110+
109111
private var shouldUpdateLayout: Bool = false
110112

111113
private var oldValueSet: CachedValueSet?
@@ -419,6 +421,7 @@ final class RideauHostingView: RideauTouchThroughView {
419421
}
420422

421423
@objc private dynamic func handlePan(gesture: UIPanGestureRecognizer) {
424+
guard self.isTerminated == false else { return }
422425

423426
func currentHidingOffset() -> CGFloat {
424427

@@ -837,7 +840,9 @@ final class RideauHostingView: RideauTouchThroughView {
837840
}
838841
)
839842

840-
isInteracting = false
843+
if target.source == .hidden {
844+
self.isTerminated = true
845+
}
841846
}
842847
default:
843848
break
@@ -877,7 +882,6 @@ final class RideauHostingView: RideauTouchThroughView {
877882
delegate?.rideauView(self.parentView!, willMoveTo: target.source)
878883
handlers.willMoveTo?(target.source)
879884
}
880-
881885
}
882886

883887
assert(currentSnapPoint != nil)

0 commit comments

Comments
 (0)