IOS native Notification Center for Nsnotificationcenter, this time with less than 300 lines of code, to achieve a similar notification of signal transmission, and further expansion of functionality.
The library name is yrsignal, which means signal: https://github.com/YueRuo/YRSignal/
The special is as follows:
1. All listeners can know who the sender is when they receive the corresponding signal
2. The listener can give the response information after processing the signal.
3. The sender can know who handled the corresponding information and what the reply message was given after processing.
4. If the listener forgets to remove itself, there will be no unsafe crashes (it is recommended to develop a good habit of removing).
This library consists of three parts:
Yrsignal class: The underlying Signal object
Yrsignalbus class: Responsible for signal scheduling, including registration, removal, and corresponding triggering
Nsobject+yrsignal class: An extension to nsobject that makes it easy for all objects to add, remove, and send messages.
Interested students can download the study, Welcome to Exchange.
Copyright NOTICE: This article is for bloggers original article, welcome reprint but please keep the article source. http://blog.csdn.net/u010124617
Simple implementation of iOS notification hubs-yrsignal