Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let package = Package(
dependencies: [
.package(
url: "https://github.com/FluidGroup/swiftui-scrollview-interoperable-drag-gesture",
from: "0.4.0"
from: "0.5.0"
),
.package(url: "https://github.com/FluidGroup/swift-rubber-banding", from: "1.0.0"),
],
Expand Down
6 changes: 2 additions & 4 deletions Rideau/Core/RideauHostingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ final class RideauHostingView: RideauTouchThroughView {
ignoresScrollView: false,
targetEdges: .top,
sticksToEdges: true,
edgeActivationMode: .onlyAtGestureStart,
minimumActivationDistance: 15
edgeActivationMode: .onlyAtGestureStart
)
)

Expand Down Expand Up @@ -220,8 +219,7 @@ final class RideauHostingView: RideauTouchThroughView {
ignoresScrollView: ignoresScrollView,
targetEdges: .top,
sticksToEdges: true,
edgeActivationMode: .onlyAtGestureStart,
minimumActivationDistance: 15
edgeActivationMode: .onlyAtGestureStart
)
}

Expand Down
19 changes: 10 additions & 9 deletions Rideau/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ its valid range. The implementation should follow this spec.

Configuration:
`edgeActivationMode: .onlyAtGestureStart`, `targetEdges: .top`,
`sticksToEdges: true`, `minimumActivationDistance: 15`
`sticksToEdges: true`

- Consume movement smaller than 15 pt and do not forward it to Rideau.
- Rely on `UIPanGestureRecognizer`'s built-in recognition slop only; do not
apply an additional activation distance on top.
- While `isScrollLockEnabled == true`, fully lock the inner scroll view and send
all translation to the outer drag.
- While `isScrollLockEnabled == false`, activate the outer drag only if the
Expand Down Expand Up @@ -102,12 +103,13 @@ ownership is decided by the submodule using `.onlyAtGestureStart`.
- `targetEdges: .top`. No coordination is performed for the bottom edge.
- Horizontal scrolling should always remain free and must not be locked.

### 3.4 The 15 pt Gate
### 3.4 Activation Slop

- The 15 pt threshold is owned entirely by the submodule through
`minimumActivationDistance: 15`.
- Rideau should not apply its own additional gate. Once `onChange` fires,
Rideau can assume the user has already moved at least 15 pt.
- Recognition slop is delegated to `UIPanGestureRecognizer`'s built-in
threshold. The submodule does not add an additional activation distance,
because doing so would let the inner scroll view rubber-band/scroll while
the outer drag is still gated.
- Rideau should not apply its own gate either.

## 4. Snap Resolution on Gesture End

Expand Down Expand Up @@ -174,12 +176,11 @@ ownership is decided by the submodule using `.onlyAtGestureStart`.
- dynamic switching of `isScrollLockEnabled`
- configurable `targetEdges`
- `edgeActivationMode: .onlyAtGestureStart`
- configurable `minimumActivationDistance`
- deceleration cancellation when locking and unlocking
- scroll-indicator hiding while locked

Minimum version:
`swiftui-scrollview-interoperable-drag-gesture` `0.4.0`
`swiftui-scrollview-interoperable-drag-gesture` `0.5.0`

## 7. Acceptance Tests

Expand Down
Loading