1

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().

alexburtnik
  • 7,661
  • 4
  • 32
  • 70
Hicham Bagui
  • 240
  • 1
  • 17
  • 2
    Could it be that `SCNetworkReachabilityCreateWithName` is now correctly converted in Swift3? I that case just drop the `takeRetainedValue()`. – rckoenes Nov 10 '16 at 16:05
  • 1
    `takeRetainedValue()` is not needed here since Swift 2, compare http://stackoverflow.com/questions/27142263/working-with-c-apis-from-swift. – Martin R Nov 10 '16 at 16:20

1 Answers1

2

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

var reachability = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, "www.apple.com")
Kevin Sabbe
  • 1,412
  • 16
  • 24