UILabel var flightTileImage: UIImageView var viewModel: FlightViewModel func refresh() { flightTileTitle.text = viewModel.flightTileTitle flightTileSubtitle.text = viewModel.flightTileSubtitle flightTileImage.image = viewModel.flightTileImage } } VM M VC V
UILabel var flightTileImage: UIImageView var viewModel: HomeViewControllerViewModel func refresh() { flightTileTitle.text = viewModel.flightTileTitle flightTileSubtitle.text = viewModel.flightTileSubtitle flightTileImage.image = viewModel.flightTileImage } } VM M VC V
} var flightTileSubtitle: String { get } var flightTileImage: UIImage { get } } class HomeViewController: UIViewController { var flightTileTitle:UILabel var flightTileSubtitle: UILabel var flightTileImage: UIImageView var viewModel: HomeViewControllerViewModel func refresh() { flightTileTitle.text = viewModel.flightTileTitle flightTileSubtitle.text = viewModel.flightTileSubtitle flightTileImage.image = viewModel.flightTileImage } } VM M VC V
UILabel var flightTileImage: UIImageView var viewModel: HomeViewControllerViewModel func refresh() { flightTileTitle.text = viewModel.flightTileTitle flightTileSubtitle.text = viewModel.flightTileSubtitle flightTileImage.image = viewModel.flightTileImage } } VM M VC V
UILabel var image: UIImageView var viewModel: ImageTileViewModel func refresh() { tileTitle.text = viewModel.tileTitle tileSubtitle.text = viewModel.tileSubtitle tileImage.image = viewModel.tileImage } } VM M V
tileTitle: String { return "\(model.firstName) \(model.lastName)” } var tileSubtitle: String { return "\(model.profession)" } var tileImage: UIImage { return UIImage(named:”IC_PERSON”) } } VM M V
viewModel: HomeViewControllerViewModel func refresh() { flightTile.viewModel = viewModel.flightTileViewModel } } VM M VC V protocol HomeViewControllerViewModel { var flightTileViewModel: ImageTileViewModel { get } }