SkillAgentSearch skills...

NotificationUnregistering

Testing the behavior of the block based NotificationCenter API. Do you have to call NotificationCenter.removeObserver(_:) or is it enough to let the observer token go out of scope? Turns out: the former (tested on iOS 11.2).

Install / Use

/learn @ole/NotificationUnregistering
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Do you have to manually unregister block-based NotificationCenter observers?

tl;dr: yes. (Tested on iOS 11.2.)

For more info, see the accompanying article.

This is the test app I used to test the behavior of NotificationCenter.addObserver(forName:object:queue:using:) under various scenarios.

Related Skills

View on GitHub
GitHub Stars16
CategoryDevelopment
Updated6mo ago
Forks2

Languages

Swift

Security Score

67/100

Audited on Sep 12, 2025

No findings