Reactive Cocoa limit a signal to only one subscriber at once

耗尽温柔 提交于 2019-12-10 21:52:14

问题


I need to model following in RAC.

I have a tabBarController which will subscribe to a notification signal. Say push notification. Also say currently active view controller may also be want to subscribe to the same signal. But if any view controller subscribed to it tabBarController doesn't want to handle it. Otherwise it will handle it. Also when current visible view controller changes. It needs to delegate back the responsibility to tabController.

Currently without RAC I maintain array of observers at tabController. If any observer present for particular kind of notification. It will delegate to viewController otherwise tabController will take care of it.

Any better way to model this using RAC?

来源:https://stackoverflow.com/questions/36026927/reactive-cocoa-limit-a-signal-to-only-one-subscriber-at-once

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!