Last active
April 27, 2020 02:30
-
-
Save TungVuDuc2805/4905bfb7eae4c7fa70aced6a0a22efe7 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 Loader {} | |
class RemoteLoader: Loader {...} | |
class LocalLoader: Loader {...} | |
class ViewControllerA { | |
private var loader: Loader? | |
init(){ | |
loader = RemoteLoader() | |
} | |
} | |
let viewControllerA = ViewControllerA() | |
class ViewControllerB { | |
private var loader: Loader? | |
init(loader: Loader){ | |
self.loader = loader | |
} | |
} | |
let loader = RemoteLoader() | |
let viewControllerB = ViewControllerB(loader: loader) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment