测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可协议 | MIT |
发布日期最后发布 | 2017年1月 |
SwiftSwift版本 | 3.0 |
SPM支持SPM | ✗ |
由 roshanman 维护。
依赖项 | |
RxSwift | >= 0 |
RxCocoa | >= 0 |
RxUIAlertController 是一个包装库,用于与 RxSwift 和 UIAlertController 一起工作。
RxUIAlertController 通过 CocoaPods 可用。
pod 'RxUIAlertController'
Alert(title: "Test", message: "This is a test message.")
.addAction(title: "Yes")
.addAction(title: "No", style: .destructive)
.addTextField{
$0.placeholder = "placeholder"
}
.rx.show()
.subscribe(onNext: {
print("button: \($0.buttonTitle)")
print($0.controller.textFields?.first?.text ?? "")
})
.addDisposableTo(disposeBag)
ActionSheet(title: "Test", message: "This is a test message.")
.addAction(title: "Yes")
.addAction(title: "No", style: .destructive)
.addAction(title: "Cancel", style: .cancel)
.setPresenting(source: sender)
.rx.show()
.subscribe(onNext: {
print("button: \($0.buttonTitle)")
})
.addDisposableTo(disposeBag)
要运行示例项目,请首先克隆存储库,然后在 Example 目录中运行 pod install
。
RxUIAlertController 在 MIT 许可协议下可用。有关更多信息,请参阅 LICENSE 文件。