My code snipet as follows …:
let defaultRouteReachability = withUnsafePointer(to: &zeroAddress) {
SCNetworkReachabilityCreateWithAddress(nil,
From the Release Notes of Xcode 8 beta 6:
- An
Unsafe[Mutable]RawPointertype has been introduced, replacingUnsafe[Mutable]Pointer. Conversion fromUnsafePointertoUnsafePointerhas been disallowed.Unsafe[Mutable]RawPointerprovides an API for untyped memory access, and an API for binding memory to a type. Binding memory allows for safe conversion between pointer types. SeebindMemory(to:capacity:),assumingMemoryBound(to:), andwithMemoryRebound(to:capacity:). (SE-0107)
In your case, you may need to write something like this:
let defaultRouteReachability = withUnsafePointer(to: &zeroAddress) {
$0.withMemoryRebound(to: sockaddr.self, capacity: 1) {zeroSockAddress in
SCNetworkReachabilityCreateWithAddress(nil, zeroSockAddress)
}
}