Reachability
Reachability copied to clipboard
reachabilityWithHostname not available in Swift?
Hi! I was using reachabilityWithHostname with great results on Objective-C and after switching to Swift, I couldn't use reachabilityWithHostname anymore as it seems to be missing. Is there any reason for this?
Did you try this?
let reachability = Reachability(hostName: "www.yoursite.com")
Hi. When not exist site search, always return 'true' Is there any reason for this? `
let notexgist12341234 = Reachability(hostName: "www.notexgist12341234.com")
let a = Reachability(hostname: "https://api-dev.allawin.co.kra")
let b = Reachability(hostname: Config.apiAddress)
let c = Reachability.reachabilityForInternetConnection()
print ("notexgist12341234 : \(notexgist12341234) \(notexgist12341234.isReachableViaWWAN()) \(yoursite12341234.isReachableViaWiFi()) ")
print ("a : \(a) \(a.isReachableViaWWAN()) \(a.isReachableViaWiFi()) ")
print ("b : \(b) \(b.isReachableViaWWAN()) \(b.isReachableViaWiFi()) ")
print ("c : \(c) \(c.isReachableViaWWAN()) \(c.isReachableViaWiFi()) ")
`
["yoursite12341234 : <Reachability: 0x26f98fc0 (-R -------)> false true "] ["a : <Reachability: 0x280b3cc0 (-R -------)> false true "] ["b : <Reachability: 0x280b42f0 (-R -------)> false true "] ["c : <Reachability: 0x280b2ce0 (-R -------)> false true "]
I checked issue. When returned call back. It's value correct in iOS 9.x iOS 8.x is always correct value