Skip to content

Instantly share code, notes, and snippets.

@ktanaka117
Created February 18, 2016 04:05
Show Gist options
  • Save ktanaka117/eddeb6b1efaf9dc3aa1d to your computer and use it in GitHub Desktop.
Save ktanaka117/eddeb6b1efaf9dc3aa1d to your computer and use it in GitHub Desktop.
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