Created
April 6, 2018 09:12
-
-
Save nikolaykasyanov/0236d8889f8e1f7e57f04ed1a27daa0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment