Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No Internet Connection Handling on UIWebView and NSURLRequest [duplicate]

I have an app which is entirely web-based and needs an internet connection to navigate around. Basically a website viewed through a UIWebView.

I need to be able to tell the user that no pages can load if they have no internet connection. Is there a simple way I can do this. Perhaps a check if NSURLRequest failed?

Cheers

like image 553
Dan Hanly Avatar asked Apr 27 '11 08:04

Dan Hanly


1 Answers

I would look at Apple's Reachability sample code to implement this reliably. One advantage of this approach is that you can notify the user as to current network status even the user isn't actually clicking on any links in the web view.

like image 82
Damien Avatar answered Oct 12 '22 23:10

Damien