Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reachabilityWithHostname not available in Swift? #141

Open
paulgoh opened this issue Jun 16, 2016 · 3 comments
Open

reachabilityWithHostname not available in Swift? #141

paulgoh opened this issue Jun 16, 2016 · 3 comments

Comments

@paulgoh
Copy link

paulgoh commented Jun 16, 2016

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?

@kevin-hirsch
Copy link

Did you try this?

let reachability = Reachability(hostName: "www.yoursite.com")

@saintevil
Copy link

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 "]

@saintevil
Copy link

I checked issue.
When returned call back. It's value correct in iOS 9.x
iOS 8.x is always correct value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants