Just getting started with the iOS features here and was wondering if there’s any way to read the contents of an iOSHTMLViewer - i.e. my thought was to get the html viewer to get the location of the iOS device (which I’m supposing it ought to be able to do), display it in plain text and then parse the results for the purposes of the rest of the app I’m trying to build. So far all I can see is that the viewer takes a URL and displays it (if possible) and that’s it, nothing else: no way to read back the ‘insides’ of the control.
I wanted to see how to implement CancelLoad and the Title property, but could not find anything that resembles.
I may be mistaken, but there seem to be no way either to access the DOM.
Same thing for Document.Title and maybe one could catch the click on a link to do sort of a CancelLoad.
I am a lot better at reading what a class can do than creating the declares. Actually, it has become easier for me since Swift, as I am better able to understand how it works than all too esoteric for me OC.
I have never created a delegate. I am just barely able to set or get a property. Maybe with the help of your DeclareMaker I still have to try (thank you!). I will probably try tomorrow.
From what I can read, though, webView:shouldStartLoadWithRequest:navigationType: does provide the CancelLoad functionality, but no window title, or obvious access to the DOM. That class seems awfully limited.
I have been thinking about making a post about creating a delegate like this for a while. DeclareMaker doesn’t have the ability to create a delegate right now, but honestly it is fairly easy so a post explaining it would probably suffice. Let me see what I can do in the coming days, my plate is kind of fully right now…
Almost one month after the last entry here: @David, did you solve that issue? If you maintain a separate delegate, it should check for the existence of its parent control before it tries to call a method on it.
In many cases, mostly those where the class does not retain the delegate, I find it much easier to implement the delegate methods on the control itself. Gets you rid of complicated delegate object retainment and eliminates Nil exceptions.