I'm facing a problem with reachability class in Swift, I'm using the following code to get it to work, but something seems to be wrong..
import Foundation
class NetworkConnect {
static let sharedInstance = NetworkConnect()
private init() {
}
func connected() -> Bool {
var reachability : Reachability = Reachability.reachabilityForInternetConnection()
var networkStatus : NetworkStatus = reachability.currentReachabilityStatus
if networkStatus.value == NotReachable.value {
return false
} else {
return true
}
}
}
I am getting this error:
'Reachability.NetworkStatus' is not convertible to 'NetworkStatus'
How can I fix that?