Skip to content

Instantly share code, notes, and snippets.

@ivanbruel
Created March 11, 2016 14:16
Show Gist options
  • Save ivanbruel/a581668425d38160d118 to your computer and use it in GitHub Desktop.
Save ivanbruel/a581668425d38160d118 to your computer and use it in GitHub Desktop.
class AnimalViewModel {
let name: String
let image: UIImage
private let _hungry: Variable<Bool>
var hungry: Observable<Bool> {
return _hungry.asObservable()
}
init(animal: Animal) {
name = animal.name
image = animal.image
_hungry = Variable(false)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment