LoginSignup
1
2

More than 3 years have passed since last update.

UIAlertController をRxSwiftを使って拡張してみました。

Posted at

UIAlertController RxSwiftでUIViewController拡張

RxSwiftを使って、UIViewControllerを拡張してみました。

引用:
https://qiita.com/katafuchix/items/50266e0eb52a032c9629

cocoapod

pod 'RxUIAlert'

Carthage

github "RxSwiftCommunity/RxAlert"

これで動きます。

Sample code


override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        alert(title: "WOW", actions: [AlertAction(title: "OK", type: 0, style: .default)], vc: self).subscribe(onNext: { (num) in

        }).disposed(by: disposeBag)
    }

RxCommunity

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2