AVReachability is a swift class that lets you check for network connectivity. Written in Swift 5.0 for iOS 12 on Xcode 10.2.1 (10E1001).
Checking for connectivity is as simple as:
if Reachability.isConnectedToNetwork() == true
{
//Do something
}
Xcode 10
AVReachability is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'AVReachability'
Isuru Nanayakkara for his answer here on StackOverflow.