
Notification Center - 옵저버 등록과 제거
var observer: NSObjectProtocol? observer = NotificationCenter.default.addObserver(forName: UIApplication.userDidTakeScreenshotNotification, object: nil, queue: nil) { notification in print("user take screenshot!") NotificationCenter.default.removeObserver(observer!) } Notification Center 등록된 옵저버들에게 노티피케이션을 보낼 수 있는 클래스이다. 모든 애플리케이션은 default Notification Center 를 가지고 있다. 노티피케이션을 그룹화하기 위해 새로운 Notif..
Comment