Created
April 26, 2020 13:45
-
-
Save cipolleschi/cbe4f65e61766a43b5f44219cce72261 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| var observers: [String: <#ObserverType#>] = [:] | |
| func add(observer: <#ObserverType#>) -> String { | |
| let uuid = UUID().uuidString | |
| self.observers[uuid] = observer | |
| return uuid | |
| } | |
| func remove(observer uuid: String) { | |
| self.observers.remove(at: uuid) | |
| } | |
| func notifyObservers(<#paramList#>>) { | |
| self.observers.forEach { $0.<#notifyMethod#> } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment