Reachability.swift: Type 'Reachability' has no member 'reachabilityForInternetConnection'

Created on 21 Sep 2016  路  5Comments  路  Source: ashleymills/Reachability.swift

after upgrading pod reachability 3, i am getting above error

Most helpful comment

RTFM: https://github.com/ashleymills/Reachability.swift#swift-3-breaking-changes

       do {
            reachability = try Reachability.reachabilityForInternetConnection()
        } catch {
            print("Unable to create Reachability")
            return
        }

is now simply,

let reachability = Reachability()

All 5 comments

See readme for Swift 3 breaking changes

Got the same issue.. Below code doesn't support Swift 3. Any solution ?

do {
            reachability = try Reachability.reachabilityForInternetConnection()
        } catch {
            print("Unable to create Reachability")
            return
        }

See readme for swift 3 breaking changes

RTFM: https://github.com/ashleymills/Reachability.swift#swift-3-breaking-changes

       do {
            reachability = try Reachability.reachabilityForInternetConnection()
        } catch {
            print("Unable to create Reachability")
            return
        }

is now simply,

let reachability = Reachability()

reachability.isReachable
works for me for ReachabilitySwift
_Swift version 4.0.3_

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rjt3662 picture rjt3662  路  3Comments

obrhoff picture obrhoff  路  3Comments

bclymer picture bclymer  路  12Comments

tjarbo picture tjarbo  路  12Comments

jet-snag picture jet-snag  路  3Comments