-
-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
Helpful when completely custom navigation is required, like presenting a modal from: ``` WKUIDelegate.webView(_:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:) ```
with option to override.
fd8ff93
to
e476134
Compare
@joemasilotti Can you elaborate on:
What specific protocol would be vulnerable to lagging behind iOS? |
Looking ahead, if we extend this approach to other Apple frameworks the same problem would apply. |
Ah ok. I'm not quite sure I understand, fully. It looks like you're implementing 2 methods out of many here: https://developer.apple.com/documentation/webkit/wkuidelegate Is that just an example of providing two capabilities, but we'd provide more empty implementations if we went down this path? |
Ah, you're right. See, I already forgot! 😆 This implementation should declare every one of the 18 functions on the protocol. |
Ha, yeah that won't work. We don't want to have to be in control of exposing every But for anything that's specific to |
Both of those sound right to me. I'd love to follow the guidance of the Android version of this, as you recommended earlier. For example, a new But I can't seem to break the dependency between these tertiary objects and the core of If we don't avoid this then when a developer subclasses I can't tell if the current architecture is prohibiting this or we are going to run into this wall no matter what. I'm leaning towards going back to the original implementation of protocol/delegate and exposing all of The downside is that we will no longer "wrap" the Edit: Implemented in #73. |
Closed in favor of #74. |
This PR is an experiment to solve #69.
It flips the entire usage of
TurboNavigator
from delegate callbacks via theTurboNavigationDelegate
to subclassing. Now, to customize behavior, you provide a custom subclass of the navigator.Example
Now, to override different functionality a developer can subclass
TurboNavigator
.Benefits
SessionDelegate
,WKUIDelegate
, or whatever we add in the futureDrawbacks
I'm most concerned about the first drawback because it means Turbo Navigator / turbo-ios can potentially lag behind iOS releases if a new callback is added to an Apple API. This is where default implementations in extensions have a huge benefit.