One of the tabs in my app loads a webpage that changes periodically. Because of this, I have the ViewController load the webView in viewWillAppear. The problem is I don’t want the webView to load every time, just when it is the first time to load, or when the webView is different. So, I have this setup:
NSURLRequest *currentRequest = [worship request];
NSURL *currentURL2 = [currentRequest URL];
if (currentURL.absoluteString == nil) {
//loads the page
}
else {
//page is already loaded, do nothing more
}
The issue is that because of it checking for a url, it takes it a few seconds to go from one tab to another. Suggestions?
Set a boolean property like webViewLoaded to YES.
and keep it NO in the init method.
check its value and load the webview and modify the value accordingly.