Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created November 28, 2017 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azamsharp/17c3a4b6c982eca7b5c4ec08c32097fc to your computer and use it in GitHub Desktop.
Save azamsharp/17c3a4b6c982eca7b5c4ec08c32097fc to your computer and use it in GitHub Desktop.
AddSourceViewModel
override func viewDidLoad() {
super.viewDidLoad()
self.addSourceViewModel = AddSourceViewModel()
self.descriptionTextView.bind { count,limit in
self.remainingCharactersCountLabel.text = "\(self.addSourceViewModel.remainingNumberOfAllowedCharacters(numberOfCharactersEntered: count, limit:limit))"
}.limit(to: Maximum.allowedCharactersForDescription)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment