Handling Internet Connection reachability Swift 5. Article link: http://www.popcornomnom.com/handling-internet-connection-reachability-on-ios-swift-5/
class ReachabilityHandler: ReachabilityObserverDelegate { | |
//MARK: Lifecycle | |
required init() { | |
try? addReachabilityObserver() | |
} | |
deinit { | |
removeReachabilityObserver() | |
} | |
//MARK: Reachability | |
func reachabilityChanged(_ isReachable: Bool) { | |
if !isReachable { | |
print("No internet connection") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment