nikolaykasyanov
4/6/2018 - 9:12 AM

ExternalService.swift

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