Stop webview reload/refresh when app comes to Foreground - ios

I m working on a multiview UIWebView. This webview loaded an external url. This url get reloaded everytime the app comes to the foreground and goes to the first page. This is causing the user to enter any kind of data again and again. Is there a way to stop this url from reloading from webview?
I have already tried using:
1. [self.webView stopLoading];
2. shouldStartLoadingWithRequest making it return NO;
3. UIWebViewNaviagationTypeReload and UIWebViewNaviagationTypeOther
to check if the webviews load status.
But no luck. The Webview keeps reloading?
Can anyone tell me is there any other way to stop the refresh for this url inside webview?

Related

Detect empty page in WKWebView

I have an iOS application which uses a WKWebView to display a webpage I do not have under my control. This webpage is a PWA (progressive web app) which at some points uses history.back(). Throughout the application this is no problem, but when called on the "start" page, nothing happens.
Flow:
Empty (= freshly initialised webview)
webView.load(URLRequest(url: URL(string: "https://pwa.example.com")!))
User presses button in pwa which calls history.back()
Nothing happens
In regular, desktop browsers this leads back to the start/new-tab page (if launched in empty tab/window) or to the page that was loaded before.
My goal is to detect that we are at the "start" again and close the webview. I tried every method from WKNavigationDelegate & WKUIDelegate but with no success so far.

UWP Webview has no resume function

UWP Webview I am using it in C#/xaml app, to load websites, it has stop() method to halt the content loading but when I want to resume content loading, after it being stopped, how can I do that? for example, I have several webviews on same page, and at start I halt all of them for good performance, but then according to user commands I want to resume their content loading, and then if I want to stop again I can stop, also does stop method means that it pauses the content load? or stops it completely? so that next time we have to navigate again?
Stop is like the browser "Stop" button. It halts all content download and is not resumable.
You'll need to reload/refresh the page that you want to "resume." Depending on the web page, some of the content maybe cached locally already so to the user it may appear as if it loads more quickly.

ios 8.3 UIWebView loading indicator not dissapearing

I have a controller with a webview that loads some links. If the link takes some time to load, the webview shows a loading indicator (I don't do it, it is done automatically). If the link does not load, and the user goes back, while he goes to the previous controller, the webview's loading indicator is still active. Any suggestions on how to hide it?
EDIT: image of the indicator I mean:
Indicator
I assume you are referring to the indicator in the status bar that shows when there is network activity. If so, this indicator is controlled by calling
[[UIApplication sharedApplication].networkActivityIndicator=YES|NO;
Applications need to manage the indicator. UIWebView nor the URL loading components of iOS will do this for you.
You should stop a UIWebView instance from continuing to load its view by calling stopLoading.

IPhone UIWebView Application wit AJAX

I'm doing now an iPhone App that encapsulate a web Site inside a UIWebView, the first request is made by the iphone app and it activate the "webViewDidFinishLoad" delegate, but when i press on one of the buttons in the web application inside the UIWebView this delegate is not working, do i need to do anything more in the ViewController or in the Html?
I Think i understand the specific problem: the next calls from the UIWebView are AJAX calls and it does not monitored by the webViewDidFinishLoad, i need some help, anyone know how to handle AJAC calls from UIWebView?
Thanks
Shimon
The right way to do it is to add UIGestureRecognizer to the UIWebView, and in the handler read the UIWebView string, then you can see the AJAX Updates done after the UIWebView was loaded for the first time' solved my problem

Refresh UIwebview without any shaking?

Currently iam refreshing webview using the following code
[webview reload];
but in this case when i open that viewcontroller i can see a sudden movement(shake or jump) of UIWebview in viewcontroller .Is there any way to to this refresh in background i mean without any change in webview movement?
You van do the same refresh functionality as a background thread,So it will work.

Resources