Created
January 22, 2023 01:44
-
-
Save soapyigu/a6c45416ff2497d8f61f9125450c1bb4 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
class NotificationCenter { | |
static let shared = NotificationCenter() | |
// notification to (class name and closures) | |
private var notificationsStorage = [String: [(String: [(String, Any) -> Void)]]]() | |
private init() { } | |
func addObserver(_ class: Any?, name: String, closure: @escaping (String, Any) -> Void) { } | |
func removeObserver(_ class: Any?, name: String) { } | |
func postNotification(_ name: String, _ object: Any?) { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment