Closed mattmeier closed 9 years ago
You shouldn't need to call the singleton method to load webview since it has a built in 'load request' method. This method simply initiates the load the process and doesn't block the main thread.
You should integrate the networking check so that it is checked before every network attempt. Something like:
getDataForURL(..) {
if (![self isNetworkAvailable]) return;
NSURLSession....
}
- (BOOL)isNetworkAvailable {
if (...) {
return YES;
} esle {
UIAlertView *alert = ....
return NO;
}
For this assignment, you can limit the networking to you own networking calls (i.e. you don't need to check the network before loading the web view). You can assume that if you can get the RSS data that the web view will be able load.
UIWebView has several delegate methods that would allow you to determine network activity and also determine if a webpage loaded properly.
Sorry, if this is a stupid question, but I can't figure out how to actually call the
function from Andrew's gist in practice, i.e. how the syntax and some example parameters would look like in a call to it (I get it for the other non-block statements of the singleton).
Should we check the network availability only when we download the RSS feed or also every single time we load a URL, in particular of the webView? Also, I guess we have to call the Singleton getWeatherForURL method each time before we load a webView, right?