Reachability.swift
Reachability.swift copied to clipboard
Under what conditions can init fail?
I noticed that the initializers on Reachability are failable, but I'm having a hard time figuring out under what circumstances this can actually happen. i.e. will this only happen if some call to malloc
fails deep inside of SCNetworkReachabilityCreateWithAddress
? I need to understand the risks of doing something like Reachability()!
.
If you have any insight here, could you add a comment to init
which describes the conditions under which it can fail?
Thanks!
Did you ever get any answers on this?
I get a crash in the convenience init?
at guard let ref = SCNetworkReachabilityCreateWithAddress(nil, &zeroAddress) else { return nil }