Created
November 27, 2015 11:02
-
-
Save 53ningen/ed5f08c37bc8c02e5b31 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
button.rx_tap | |
.flatMap { () -> Observable<String> in | |
if (self.textField3.text?.characters.count > 0) ?? false { | |
return just(String(self.textField3.text!)) | |
} else { | |
return failWith(NSError(domain: "app error", code: -1, userInfo: nil)) | |
} | |
} | |
.subscribe( | |
onNext: { self.showAlert("値は\($0)") }, | |
onError: { _ in self.showAlert("空ですな...")}, | |
onCompleted: nil, | |
onDisposed: nil | |
) | |
.addDisposableTo(disposeBag) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment