Skip to content

Instantly share code, notes, and snippets.

@HelloCore
Last active February 6, 2018 10:26
Show Gist options
  • Save HelloCore/1fbb9f2bfdd69bc616526b06b8d054f8 to your computer and use it in GitHub Desktop.
Save HelloCore/1fbb9f2bfdd69bc616526b06b8d054f8 to your computer and use it in GitHub Desktop.
textField
.rx //** <--- สำคัญมาก
.text
.orEmpty
.asObservable()
.subscribe(onNext: { (str) in
print("TextField1 str: [\(str)]")
})
.disposed(by: disposeBag)
/* --[Console Output]--
TextField1 str: []
TextField1 str: [a]
TextField1 str: [as]
TextField1 str: [asd]
TextField1 str: [asdf]
TextField1 str: [asdfg]
TextField1 str: [asdfgh]
TextField1 str: [asdfghj]
TextField1 str: [asdfghjk]
TextField1 str: [asdfghjkl]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment