Default argument not permitted in a protocol method(删除默认参数 = nil )
![](https://img.haomeiwen.com/i9129568/afec9d7af2dd2122.png)
Extensions must not contain stored properties
![](https://img.haomeiwen.com/i9129568/814b11115ec003af.png)
对RxSwift进行简单封装,需要使用到PublishSubject对象与DisposeBage,理想实现是所有工作都在协议层完成,直接遵循协议即可快速使用。既然协议本身限制实现不了,那么我们就绕个弯实现
//增加中间对象,协议中直接使用
struct rx {
static var subject: PublishSubject<Any> = PublishSubject()
static var disposeBag: DisposeBag = DisposeBag()
}
网友评论