protocol ReachabilityDelegate: class {
func reachabilityDidChange(_ reachable: Bool)
}
class Reachability {
weak var delegate: ReachabilityDelegate?
}
class Model: ReachabilityDelegate {
func reachabilityDidChange(_ reachable: Bool) {
print("what's up?")
}
}
// this happens in factory
let reachability = Reachability()
let model = Model()
reachability.delegate = model