<commit_before>Network reachability for iOS
============
---
SCNetworkReachability class is the wrapper on C-structures and C-functions of [SCNetworkReachability API](https://developer.apple.com/library/mac/#documentation/SystemConfiguration/Reference/SCNetworkReachabilityRef/Reference/reference.html#//apple_ref/doc/uid/TP40007260) in [SystemConfiguration.framework](https://developer.apple.com/library/mac/#documentation/Networking/Reference/SysConfig/_index.html#//apple_ref/doc/uid/TP40001027)<commit_msg>Updated README file: - added installation instructions - added using instructions<commit_after>Network reachability for iOS
============
---
# About
SCNetworkReachability class is the wrapper on C-structures and C-functions of [SCNetworkReachability API](https://developer.apple.com/library/mac/#documentation/SystemConfiguration/Reference/SCNetworkReachabilityRef/Reference/reference.html#//apple_ref/doc/uid/TP40007260) in [SystemConfiguration.framework](https://developer.apple.com/library/mac/#documentation/Networking/Reference/SysConfig/_index.html#//apple_ref/doc/uid/TP40001027)

# Installation
Add 'reachability-iOS' as git-submodule to your project:

	cd <project source directory>
	git submodule add https://github.com/belkevich/reachability-ios.git <submodules directory>

And add files to your XCode project

# Using
## Check internet connection now

```objective-c
SCNetworkReachability *reachability = [[SCNetworkReachability alloc] initWithHostName:@"www.apple.com"];
if (reachability.status == SCNetworkStatusNotReachable)
{
	// no internet connection
} 
else
{
	// do network connection
}
```

## Check is connection via Wi-Fi or Cellular

```objectiv-c
if (reachability.status == SCNetworkStatusViaCellular)
{
	// internet connection via cellular
} 
else if (reachability.status == SCNetworkStatusViaWiFi)
{
	// internet connection via Wi-Fi 
}
`
```

## Check is connection status changed

Class that will be check changes should implement `SCNetworkReachabilityDelegate` protocol methods:

```objective-c
@required
- (void)reachabilityDidChange:(SCNetworkReachability *)reachability;

@optional
- (void)reachability:(SCNetworkReachability *)reachability didFail:(NSError *)error;

```

And set reachability instance delegate to self

```objective-c
reachability.delegate = self;
```
{'fraction_non_alphanumeric': 0.11759619541720709, 'fraction_numerical': 0.013834846519671422, 'mean_word_length': 6.186335403726708, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 5, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3535232', 'n_tokens_mistral': 693, 'n_tokens_neox': 642, 'n_words': 148}