Skip to content

Instantly share code, notes, and snippets.

@leontiy
Last active February 6, 2017 17:12
Show Gist options
  • Save leontiy/8386e5d6bb3403b14c8016d3b8311642 to your computer and use it in GitHub Desktop.
Save leontiy/8386e5d6bb3403b14c8016d3b8311642 to your computer and use it in GitHub Desktop.
func awakeFromNib() {
super.awakeFromNib()
self.titleLabel.reactive.text <~ self.viewModel.map { $0?.title }
self.label.reactive.text <~ self.viewModel.map { $0?.text }
self.imageView.reactive.image <~ self.viewModel.producer.flatMap(.latest) {
downloadImage($0.imageUrl).map(Optional.some).prefix(value: nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment