RxViewController
RxSwift的用于UIViewController和NSViewController的包装器。
概述
在视图中控制器
self.rx.viewDidLoad
.subscribe(onNext: {
print("viewDidLoad 🎉")
})
APIs
extension Reactive where Base: UIViewController {
var viewDidLoad: ControlEvent<Void>
var viewWillAppear: ControlEvent<Bool>
var viewDidAppear: ControlEvent<Bool>
var viewWillDisappear: ControlEvent<Bool>
var viewDidDisappear: ControlEvent<Bool>
var viewWillLayoutSubviews: ControlEvent<Void>
var viewDidLayoutSubviews: ControlEvent<Void>
var willMoveToParentViewController: ControlEvent<UIViewController?>
var didMoveToParentViewController: ControlEvent<UIViewController?>
var didReceiveMemoryWarning: ControlEvent<Void>
}
public extension Reactive where Base: NSViewController {
var viewDidLoad: ControlEvent<Void>
var viewWillAppear: ControlEvent<Void>
var viewDidAppear: ControlEvent<Void>
var viewWillDisappear: ControlEvent<Void>
var viewDidDisappear: ControlEvent<Void>
var viewWillLayout: ControlEvent<Void>
var viewDidLayout: ControlEvent<Void>
}
安装
贡献
欢迎任何讨论和拉取请求
创建 Xcode 项目
$ swift package generate-xcodeproj
许可协议
RxViewController 在 MIT 许可协议之下。更多信息请参阅 LICENSE 文件。