Skip to content

Instantly share code, notes, and snippets.

@czars
Created December 9, 2016 16:09
Show Gist options
  • Save czars/6efe2bbcb112d9a86d94bddedd7af319 to your computer and use it in GitHub Desktop.
Save czars/6efe2bbcb112d9a86d94bddedd7af319 to your computer and use it in GitHub Desktop.
test
var states: Variable<[String]> = Variable([])
states.asObservable()
.filter({ (array) -> Bool in
var valid: Bool = true
for x in array {
valid = x.characters.count > 3
}
print(valid)
return valid
}).subscribe(onNext: { _ in
print("init")
}).addDisposableTo(DisposeBag())
let name = nameTextField.rx.text
name.subscribe(onNext: { (string) in
states.value.append((string as! String?)!)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment