TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Aug 2016 |
Maintained 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:
To run the example project; clone the repo, and build the exmaple project.
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.