Comments (6)
I am sure we can hook into the func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!)
function in and inspect the intended uri for any of the tab links.
My question would be on the intended behavior around the back button. It looks as though there is currently separate WKWebView instances for each page so would lose the history when we change the tab.
If we did share the history between pages if someone navigates back would we expect the tab to change again?
from dev-ios.
That's a good question. My first thought is it would move to a new tab, then load the page as part of that tab so there would be back button to take you back to the main page of the current tab.
So say I'm in Connections, I click a link that sends me to Notifications it would move to that tab, then push to the navigation stack for the Notifications tab. If I hit the back button it would go back to the main screen for Notifications. If I tap onto the Connections tab, it will be where it left off (as if nothing happened basically). Does that make sense?
from dev-ios.
Yeah that makes sense.
I had a look into this and it seems like we can't leverage the WKNavigationDelegate functions (like the one I referenced) as we aren't always initiating a full page reload. We have to use Key Value Observer pattern on the url property of webview to detect all url changes. However that means we only really intercept the event after it has occurred which would mean we would have to do a navigate backwards before changing tabs.
Seems a bit messy/hacky
Thoughts?
from dev-ios.
Additional links we'd want this behavior for is /connect and /search and maybe /new
from dev-ios.
Haven't been able to find an alternative to creating an observer on the url and undoing the navigation before going to a new tab. It is fairly quick but the back icon (if not already showing) does flash before the switch :\
Any ideas/suggestions welcome!
from dev-ios.
Closing because out of date
from dev-ios.
Related Issues (20)
- Weekly Digest (6 January, 2020 - 13 January, 2020)
- Weekly Digest (13 January, 2020 - 20 January, 2020)
- Weekly Digest (20 January, 2020 - 27 January, 2020)
- Weekly Digest (27 January, 2020 - 3 February, 2020)
- Trigger native audio play
- Trigger native video play
- Fix colors in safe area HOT 3
- Weekly Digest (3 February, 2020 - 10 February, 2020)
- Universal links not working when the app isn't installed HOT 6
- Add "skip ahead 15 seconds" to lock screen player. HOT 3
- Maintain audio playback speed if paused/played HOT 1
- Improve metadata message from native bridge
- White Lines on Top and Bottom of App in Dark Mode HOT 2
- Hacktoberfest Topic HOT 1
- Support all available themes HOT 3
- Migrate to Swift Package Manager HOT 2
- Dev Digest Links Don't Open in iOS App HOT 2
- Add cover image bug on Dev-ios / ForemWebView-iOS local build HOT 1
- App crashes when I navigate between tabs HOT 1
- Small adjustment to help with refreshing home page experience HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dev-ios.