Вопрос

we have a webview and wish that while the opening picture is shown, this webview loads in the background, and when the loading has finished, the opening picture shall disappear. We tried the sleep function for this but when we use that function, as soon as the opening picture disappears, webview starts loading (it doesn't load in the background). Most probably we need to use a applicationDidFinishLaunching style class. Can you please advise on how to use this one. Thank you

Это было полезно?

Решение

Make a imageView object containing the launch image, Have that imageView load first in your viewController and then create your webView Object. Once the webView delegate has responded with webViewDidFinishLoad (only called once the website is completely loaded) remove the image object from the view and display the webView.

Personally i would have some sort of activity indicator on screen to show the user there something loading and also implement didFailLoadWithError method in-case the website has problems.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top