Platformsios 6.0, requires ARC
FrameworksCFNetwork, MobileCoreServices, SystemConfiguration

GitHub license

SANetworkHelper makes your life easier to test network connection on a iOS device without having to spend time writing lots of code. Its has a few simple class methods that run in a background thread and return the response of the network by either using Block or Delegate.

Example method with Block:

[SANetworkTester googleDNSWithCompletion:^(NSNumber *response) {
    // handle success
    [self showAlert:[NSString stringWithFormat:@"Received %@ packets", response]];

} errorHandler:^(NSString *address, NSError *error) {
    // handle error
    [self showAlert:[NSString stringWithFormat:@"Failed %@ wError: %@", address, error.localizedDescription]];


Example method with Delegate:

  1. import < SANetworkTester.h >

  2. add Delegate to class:
  3. add two optional protocol methods: – (void)didFailToReceiveResponseFromAddress:(NSString )address withError:(NSError )error; and – (void)didReceiveResponse:(NSNumber *)response;
  4. add method to run test: [SANetworkTester googleDnsWithDelegate:self];




To run the example project; clone the repo, and build the exmaple project.


  • you need help, use Stack Overflow. (Tag ‘SANetworkTester’)
  • you’d like to ask a general question, use Stack Overflow.
  • you found a bug, and can provide steps to reliably reproduce it, open an issue.
  • you have a feature request, open an issue.
  • you want to contribute, submit a pull request.


SANetworkTester is available through CocoaPods, to install
it simply add the following line to your Podfile:

pod "SANetworkTester"

Or directly drag and drop the Source folder and add these framework: ‘CFNetwork’, ‘MobileCoreServices’, ‘SystemConfiguration’


shams-ahmed, [email protected]


SANetworkTester is available under the MIT license. See the LICENSE file for more info.

Bitdeli Badge

Latest podspec

    "name": "SANetworkTester",
    "version": "0.4.0",
    "summary": "Quick and Easy way to check for active network connection using Blocks or Delegate",
    "description": "Test network using ping test such as Google DNS(, Apple or any IP Address of your choice. Built on top of key Apple frameworks, Support ARC and iOS 6/7+",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "shams-ahmed": "Shams Ahmed"
    "source": {
        "git": "",
        "tag": "0.4.0"
    "platforms": {
        "ios": "6.0"
    "requires_arc": true,
    "source_files": "Classes/Source",
    "frameworks": [

Pin It on Pinterest

Share This