Created
February 18, 2016 04:05
-
-
Save ktanaka117/eddeb6b1efaf9dc3aa1d to your computer and use it in GitHub Desktop.
This file contains 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
import UIKit | |
import RxSwift | |
import RxBlocking | |
import RxCocoa | |
class ViewController: UIViewController { | |
@IBOutlet weak var textField: UITextField! | |
@IBOutlet weak var label: UILabel! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
textField.rx_text.filter { text -> Bool in | |
return text.characters.count >= 3 | |
}.subscribeNext { [unowned self] text in | |
self.label.text = text | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment