Created
October 19, 2019 13:09
-
-
Save isaac-weisberg/bc9a3587c6cd5e5e320ee74218894b96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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