Publisher
-
Ch2. Publishers & SubscribersRay Wenderlich/Combine 2021. 1. 27. 20:23
Hello Publisher let myNotification = Notification.Name("MyNotification") let center = NotificationCenter.default let observer = center.addObserver(forName: myNotification, object: nil, queue: nil) { (notification) in print("Notification received!") } center.post(name: myNotification, object: nil) center.removeObserver(observer) Notification received! Hello Subscriber let myNotification = Notific..