Simulate Bad Network Connection in iOS Device and Simulator

While developing an app that requires an internet connection, it is very important to handle use-cases when the connection is slow or non-existent. To figure out when there’s a bad connection via your code, you can use this great Reachability library.

Once Reachability is implement it, it’s pretty easy to test it by simulating a bad connection on your iPhone or iPhone Simulator if you know what tools to use. Here is how you can test a your app on different internet connections using your iPhone and iPhone Simulator:

 

Continue reading

Network Reachability Test and HTTP Call with AFNetworking

There are plenty of time when we need to have active internet connection for an mobile application to be used. So it is always good idea to check internet connection before the application get ready for use.

AFNetworking is one of the best iOS library out there for making HTTP request for accessing web services.  Same library is good enough for checking active internet connection. So now let’s dive into how we can constantly monitor the internet connection throughout the application.