LeoMobileDeveloper / Qteventbus
Licence: mit
iOS事件总线,支持AppDelegate解耦,支持基于响应链的局部总线
Stars: ✭ 365
Projects that are alternatives of or similar to Qteventbus
Multiplatform-Bus
Kotlin event-bus compatible with Android & native iOS
Stars: ✭ 43 (-88.22%)
Mutual labels: eventbus, notification
Blog Core
Modular blog using Blazor with clean domain-driven design patterns
Stars: ✭ 345 (-5.48%)
Mutual labels: module
Eventline
Micro-framework for routing and handling events for bots and applications 🤖. IFTTT for developers 👩💻👨💻
Stars: ✭ 305 (-16.44%)
Mutual labels: eventbus
Ngx php
ngx_php - Embedded php scripting language for nginx module. All released versions of the code repository.
Stars: ✭ 290 (-20.55%)
Mutual labels: module
Wxpusher Client
微信消息实时推送服务[WxPusher],可以通过API实时给个人微信推送消息。wechat pusher.
Stars: ✭ 352 (-3.56%)
Mutual labels: notification
Fileboy
fileboy,文件变更监听通知工具,使用 Go 编写。Fileboy, File Change Monitoring Notification Tool, written with Go.
Stars: ✭ 345 (-5.48%)
Mutual labels: notification
Notifications
NotifyMe enables you to create web notifications pretty easily - "Just Call me and Launch!!"
Stars: ✭ 327 (-10.41%)
Mutual labels: notification
Modulation
Modulation - explicit dependency management for Ruby
Stars: ✭ 306 (-16.16%)
Mutual labels: module
Ngx php7
ngx_php7 - Embedded php7 scripting language for nginx module. Mainline development version of the ngx_php.
Stars: ✭ 337 (-7.67%)
Mutual labels: module
Retry
♻️ The most advanced interruptible mechanism to perform actions repetitively until successful.
Stars: ✭ 294 (-19.45%)
Mutual labels: module
Modules
Environment Modules: provides dynamic modification of a user's environment
Stars: ✭ 344 (-5.75%)
Mutual labels: module
Alarm Ios Swift
clone of the official IOS clock alarm app written in swift
Stars: ✭ 295 (-19.18%)
Mutual labels: notification
Rspirv
Rust implementation of SPIR-V module processing functionalities
Stars: ✭ 332 (-9.04%)
Mutual labels: module
Notifications
🛎 Notifications Center engine like GitHub or other application for any Rails applications.
Stars: ✭ 359 (-1.64%)
Mutual labels: notification
Notifier
Sends notifications via one or more channels (email, SMS, ...).
Stars: ✭ 346 (-5.21%)
Mutual labels: notification
QTEventBus
QTEventBus是一个优雅的iOS事件总线,用来实现“发布-订阅”的消息通信模式。
- 支持强类型/弱类型
- 自动取消订阅
- 快速
- 兼容
NSNotification
- 单元测试覆盖
- 支持AppDelegate解耦
- 支持基于响应链的局部总线
文章:
安装
消息总线:
pod QTEventBus
AppDelegate解耦:
pod QTEventBus/AppModule
基于响应链的事件传递:
pod QTEventBus/UIKit
系统要求
- XCode 9 +
- iOS 8+
使用
QTEvent
新建一个类作为事件,实现协议@interface QTLoginEvent : NSObject<QTEvent>
@property (copy, nonatomic) NSString * userId; //可以携带任意数据
@property (copy, nonatomic) NSString * userName; //可以携带任意数据
@end
订阅这个事件
QTSub(object,className)宏的作用是在object的生命周期内,订阅className事件,当object释放的时候自动取消订阅。
//注意eventBus会持有这个block,需要弱引用object
[QTSub(self,QTLoginEvent) next:^(QTLoginEvent * event) {
NSLog(@"%ld",event.userId);
}];
如果需要在主线程订阅,使用宏QTSubMain
发布事件
QTLoginEvent * event;
[QTEventBus.shared dispatch:event];
详细文档
许可证
QTEventBus使用 MIT 许可证,详情见 LICENSE 文件。
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].