You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "jcesarmobile (JIRA)" <ji...@apache.org> on 2017/02/12 18:49:41 UTC

[jira] [Closed] (CB-12451) webViewDidFinishLoad delegate no longer available in CDVViewController

     [ https://issues.apache.org/jira/browse/CB-12451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

jcesarmobile closed CB-12451.
-----------------------------
    Resolution: Not A Problem
      Assignee: jcesarmobile

This is not a bug, those changes were made to allow "plugable webviews" as plugins, were you can use any engine (on iOS UIWebView or WKWebView), so now there is some abstraction on how to get the webview as it can have a different class depending on the engine you set.
If you haven't installed the WKWebView engine plugin, then you are using UIWebView, when you access self.webview, it's a UIView now because of the abstraction, but you can cast it to UIWebView and use it as you did before.

> webViewDidFinishLoad delegate no longer available in CDVViewController
> ----------------------------------------------------------------------
>
>                 Key: CB-12451
>                 URL: https://issues.apache.org/jira/browse/CB-12451
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaLib, iOS
>    Affects Versions: cordova-ios@4.3.1
>         Environment: phonegap cli version 6.4.3, cordova cli 6.5.0, cordova platform version iOS 4.3.1. Project uses default UIWebView. Problem is experienced on iOS 9.3.5 through 10.2 on iPhone 4, iPhone 4S and iPhone 5 (these were only the ones tested)
>            Reporter: Mark
>            Assignee: jcesarmobile
>             Fix For: cordova-ios@4.3.1
>
>
> This is a phone gap project and all object types are exactly as created when the cordova platform add iOS CLI command is executed. When using UIWebView, I manually change the interface (.h) for MainViewController.h which is a CDVViewController type to call the delegates (by adding <UIWebViewDelegate> to the interface, which means the webViewDidFinishLoad gets called, but compile fails on the [super webViewDidFinishLoad:theWebView] call with the message that there is no interface in CDVViewController for webViewDidFinishLoad. When I check the CDVViewController.m and .h files, I see the selectors / methods are no longer present when comparing to pre-4.0 cordova versions. If I then remove the [super ...] call to get it to compile then the deviceready is never called and i have to make my app lose focus before it will load.Ive added in the required <meta> tag to index.html which has no effect. I am aware the delegate is present in other files such as the navigator and CDVUIWebViewDelegate.h but these are not called or available from CDVViewController.
> I have a few apps that rely on this once standard delegate callback. I need it to be called because it is the only way i can think of to get a reference to the UIWebView that cordova uses as default. Sure, I can access self.webView or even reference the viewController webview property in other places but NONE of these are UIWebView... they are all UIView and do not allow me to call the stringByEvaluatingJavaScriptByString selector in order to execute JavaScript in the same "virtual machine" as my app runs and therefore have access to the methods in there.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org