Last active
April 4, 2020 06:54
-
-
Save zafarivaev/84792f7ff7b07c5a61b4c582929e07d3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 HolidayDetailViewController: UIViewController { | |
// MARK: - Lifecycle Methods | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
.... | |
bindViewModel() | |
} | |
override func viewWillDisappear(_ animated: Bool) { | |
super.viewWillDisappear(animated) | |
viewModel.didClose.onNext(()) | |
} | |
// MARK: - Properties | |
let disposeBag = DisposeBag() | |
var viewModel: HolidayViewModel! | |
....... | |
} | |
// MARK: - Binding | |
extension HolidayDetailViewController { | |
func bindViewModel() { | |
self.holidayNameLabel.text = viewModel.title | |
self.holidayDateLabel.text = viewModel.date | |
self.holidayCountryLabel.text = viewModel.country | |
self.isHolidayPublicLabel.text = viewModel.isPublic ? "True" : "False" | |
} | |
} | |
.... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment