to check internet connection using reachibility

1. download from Here:  https://drive.google.com/open?id=0BwU5Y4Xqfa42VTgxZURtQ1FyUlk
2. import systemContifiguration framework



INTERNET REACHABILITY CHECK IN IOS OBJECTIVE C



Open Xcode and Create a single View Application, save it and named it Like “Reachability Demo”.

Screen Shot 2016-03-15 at 12.12.23 PM

IMPORT SYSTEM CONFIGURATION FRAMEWORK AND REACHABILITY CLASS.

The Reachability class depends on the System Configuration framework for some of its functionality. With your project selected in the Project Navigator, open the Build Phases tab, and expand the Link Binary with Libraries drawer. Click the plus button and search for SystemConfiguration.framework and add it to your project.
To get the Reachability classes, Visit the project’s GitHub page, download the latest version, and drag Reachability.h/.m into your Xcode project (figure 3). If you take this path, make sure to copy the class files into your Xcode project (figure 4). You can also use CocoaPods to to add Reachability to your project.
Screen Shot 2016-03-15 at 12.42.17 PM

IMPORT FRAMEWORK IN YOUR CONTROLLER

In your view controller.m class import the system framework and Reachability.h class.
Screen Shot 2016-03-15 at 2.57.27 PM

CHECK INTERNET REACHABILITY

In your Viewdidload method add the following code to first check whether there is any internet connection available or not and also the type of connection your device is connected with.
Above code checks for the internet connection and if connection found then it shows wether the device is connected to wifi network or WWAN.

GET WIFI NETWORK NAME

To get wifi network name add the below given code in the part where it shows that device is connected to wifi. Please refer the below mentioned code and screenshot given.

RUN APPLICATION

Run your application on device and in application console check what network name your device is connected with.
Previous
Next Post »