Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // MARK: - Init
- deinit {
- NotificationCenter.default.removeObserver(self)
- }
- // MARK: - View Life Cycle
- override func viewDidLoad() {
- super.viewDidLoad()
- addObservers()
- }
- // MARK: - Add Observers
- private func addObservers() {
- NotificationCenter.default.addObserver(
- forName: .SomethingToObserveNotification,
- object: nil,
- queue: .main,
- completion: handleNotification
- )
- }
- private func handleNotification(_ notification: Notification) {
- // No-op but there is a leak in this controller!
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement