Skip to content

Instantly share code, notes, and snippets.

@isaac-weisberg
Created October 19, 2019 13:09
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 isaac-weisberg/bc9a3587c6cd5e5e320ee74218894b96 to your computer and use it in GitHub Desktop.
Save isaac-weisberg/bc9a3587c6cd5e5e320ee74218894b96 to your computer and use it in GitHub Desktop.
class MainViewController: UIViewController {
@IBOutlet var bottomErrorContainer: UIView!
@IBOutlet var bottomErrorLabel: UILabel!
func viewDidLoad() {
// ...
viewModel.minorError
.bind(onNext: { [unowned self] error in
switch error {
case .some(let error):
self.bottomErrorContainer.isHidden = false
self.bottomErrorLabel.text = error
case .none:
self.bottomErrorContainer.isHidden = true
}
})
.disposed(by: disposeBag)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment