I want to know if there is a method that goes to another viewcontroller
if there is no internet. Please help
Cheers,
Palash
I want to know if there is a method that goes to another viewcontroller
if there is no internet. Please help
Cheers,
Palash
You can use Reachability class for this purpose https://github.com/ashleymills/Reachability.swift
Usage:
let reachability = Reachability.reachabilityForInternetConnection()
reachability.whenReachable = { reachability in
if reachability.isReachableViaWiFi() {
println("Reachable via WiFi")
} else {
println("Reachable via Cellular")
}
//Load your viewController
}
reachability.whenUnreachable = { reachability in
println("Not reachable")
//Load your viewController
}
reachability.startNotifier()