SANetworkTester 0.4.0

SANetworkTester 0.4.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Aug 2016

Maintained by Shams Ahmed.



  • By
  • shams-ahmed

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];

Screenshot

Usage

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

Communication

  • 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.

Installation

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

Author

shams-ahmed, [email protected]

License

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

Bitdeli Badge