Utilizing uiwebview within my iOS application has been a great experience. I have successfully integrated a textbox above it that allows for seamless navigation of the web content. One particular example involves loading m.youtube.com, conducting a search on youtube.com, and smoothly transitioning to the video page upon selection. However, I am faced with the challenge of capturing the URL link of the video page in order to watch the selected video: m.youtube.com/watch?v=sa+2DFdfd
. The question remains - how can this be achieved?
Key observations:
Upon testing this functionality on an iPhone 5 using Safari, I observed that the navigation bar dynamically adjusts based on the current webpage. For instance, when visiting m.youtube.com/watch?v=34124S on Safari, the updated URL is clearly visible in the browser. Unfortunately, replicating this behavior within the uiwebview has proven challenging as I struggle to retrieve the latest loaded webpage link.
The ShouldLoadStart method seems to function only during the initial page load. Subsequent clicks on the webpage, especially those involving JavaScript links, tend to go unnoticed by the delegates. This limitation prevents me from efficiently capturing URLs such as m.youtube.com/watch?v=34124S as seamlessly as Safari does on YouTube pages. Any assistance in resolving this issue would be greatly appreciated.