Hicham Pirhano Hicham Pirhano - 23 days ago 12
Swift Question

Swift 2 to Swift 3

In Swift 2 I was able to write this statement:

var reachability = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, "www.apple.com").takeRetainedValue()


In Swift 3 now it says that SCNetworkReachability? has no member takeRetainedValue().

Answer

Just remove the takeRetainedValue() you don't need it anymore.

var reachability = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, "www.apple.com")
Comments