Skip to content

Let a left-edge swipe reveal the timeline over an article - #5506

Open
dave-atx wants to merge 1 commit into
Ranchero-Software:mainfrom
dave-atx:fix-article-edge-swipe
Open

dave-atx wants to merge 1 commit into
Ranchero-Software:mainfrom
dave-atx:fix-article-edge-swipe

Conversation

@dave-atx

Copy link
Copy Markdown
Contributor

On an unfolded iPhone Duo the article fills a 669pt-wide expanded split view, and swiping in from the left edge to get the timeline back does nothing. The same swipe works if it starts alongside the top or bottom toolbar.

The article is a UIPageViewController, and a no-op pan recognizer on its internal scroll view refuses simultaneous recognition within 40pt of the left edge, so an edge swipe doesn't page back and navigate back at the same time. The refusal is unconditional:

let point = gestureRecognizer.location(in: nil)
if point.x > 40 {
    return true
}
return false

Every recognizer competing for that strip gets turned away, the split view's reveal gesture included. Beside the toolbars the page view controller isn't under the touch, nothing refuses, and the reveal works.

This narrows the refusal to the one recognizer it was aimed at:

guard otherGestureRecognizer === pageViewController.scrollViewInsidePageControl?.panGestureRecognizer else {
    return true
}
return gestureRecognizer.location(in: nil).x > 40

Paging is still held back near the edge, so the original behavior is intact. Everything else gets the touch, which leaves presentsWithGesture to do the reveal and leaves the collapsed case to the navigation controller's pop.

Verified on an unfolded iPhone Duo running iOS 27.1. It isn't Duo-specific, though — any expanded split view showing the article by itself runs into it. Related to #5427.

The article is a UIPageViewController, and a no-op pan recognizer on its
internal scroll view refuses simultaneous recognition within 40pt of the
left edge, so swiping from there doesn't page back and navigate back at
the same time. It refused every other recognizer there too, including the
split view's reveal gesture. The swipe did nothing over the article while
it still worked alongside the toolbars, where the page view controller
isn't under the touch.

Narrow the refusal to the page view controller's own pan. Paging is still
held back near the edge, and everything else gets the touch.

Found on an unfolded iPhone Duo, where the article fills a 669pt-wide
expanded split view and the timeline is otherwise only reachable from the
sidebar button.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant