Anyone familiar with UIKit? Is the forward swipe in Safari a thing UINavigationController does, or is it custom? I'm failing to find any references to it in docs, and from things like https://stackoverflow.com/a/5891661 I can't tell if they are implementing a custom thing or not.

Wondering how to design API around this for AdwNavigationView but can't find any examples of existing API.

EDIT: Answer: it's custom :(

Swipe back and forward on navigationController

Each UIViewController, starting with rootViewController uses [self.navigationController pushViewController nextView] to push new views. Swipe works fine. How can I implement the same behavior for...

Stack Overflow
@alice I'm just getting started with iOS Dev. I haven't seen it in any other (non browser) apps but I doubt it's Safari only

@jaiden well, it's not Safari-only in any case since it's in WebKit, and so the code is even public[1], but it's incomprehensible.

[1]: https://github.com/WebKit/WebKit/blob/main/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm

WebKit/ViewGestureControllerIOS.mm at main · WebKit/WebKit

Home of the WebKit project, the browser engine used by Safari, Mail, App Store and many other applications on macOS, iOS and Linux. - WebKit/ViewGestureControllerIOS.mm at main · WebKit/WebKit

GitHub
@alice Deer Lord I can barely read this
@jaiden @alice it’s readable, but incredibly overcomplicated
@jamie @jaiden well, I can't even tell if it's using a UINavigationController or not... It is mentioned in other parts of the code, but not sure about this specific one (like there is some in WKContentViewInteraction.mm)
@alice @jaiden I don’t see anything about a UINavController personally
@jamie @jaiden me neither... But there's also not a lot of code for actually doing the transition, so presumably it is using something
@jamie @jaiden HMM. Unless it's using private API. Just looked up _UINavigationParallaxTransition, found https://github.com/MP0w/iOS-Headers/blob/master/Compare_Latest/Frameworks/UIKit/_UINavigationParallaxTransition.h. It's not documented, but it would explain it I guess...
iOS-Headers/_UINavigationParallaxTransition.h at master · MP0w/iOS-Headers

iOS 5.0/5.1/6.0/6.1/7.0/7.1/8.0/8.1 Headers of All Frameworks (private and not) + SpringBoard - iOS-Headers/_UINavigationParallaxTransition.h at master · MP0w/iOS-Headers

GitHub
@alice @jaiden It’s always private APIs

@alice @jaiden That or it’s APIs that don’t cleanly have a cross platform variant

* Jamie still wonders how she’ll test that she didn’t break everything with WebExtensions *

@jamie @jaiden well yeah, none of that is cross-platform. But like, here's the GTK one for comparison: https://github.com/WebKit/WebKit/blob/main/Source/WebKit/UIProcess/gtk/ViewGestureControllerGtk.cpp
WebKit/ViewGestureControllerGtk.cpp at main · WebKit/WebKit

Home of the WebKit project, the browser engine used by Safari, Mail, App Store and many other applications on macOS, iOS and Linux. - WebKit/ViewGestureControllerGtk.cpp at main · WebKit/WebKit

GitHub
@alice @jaiden much more readable although I still hate trying to read c++
@alice @jaiden reading WebKit reminds me of how bad I am at c++
@jamie @jaiden tbf C++ alone would be a lot better than that
@alice @jaiden True, but it’s still an overcomplicated mess
@alice It’s been a while since I’ve done any real iOS development, but the SO answer suggests to manually use UISwipeGestureRecognizer and manually push/present the controller from manually maintained nextViewController chain. So while UINavigationController is used for presenting and maintaining backwards navigation stack, the forward part is a manual addition albeit an easy one.
@0x1eaf hm, would that still have a fancy interactive transition though?
@alice I don’t suppose so: simply pushing the next controller upon nav controller’s stack would animate it the same way as clicking on some table view row button for navigation would. So it seems like the animation wouldn’t be tied to the current swipe gesture and wouldn’t be interruptible by it. Maybe there’s is some way to tie it to the current gesture from the recogniser, but I’m out of depth here.
@0x1eaf yeah... Alright, so it is entirely custom then, good to know
@alice And the ViewGestureControllerIOS.mm code you’ve shared seems to manually setup a transition animation in ViewGestureController::beginSwipeGesture() using a snapshot view.