Last active
August 18, 2018 03:15
-
-
Save Abhishek9634/dd0a5bd5ea31c19eefd0059261140afa 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
extension BeerListViewController: UITableViewDelegate, UITableViewDataSource { | |
func tableView(_ tableView: UITableView, | |
numberOfRowsInSection section: Int) -> Int { | |
return self.viewModel.itemCount | |
} | |
func tableView(_ tableView: UITableView, | |
cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
let cell = tableView.dequeueReusableCell( | |
withIdentifier: "BeerTableViewCell" | |
) as! BeerTableViewCell | |
cell.delegate = self | |
cell.item = self.viewModel.item(indexPath) | |
return cell | |
} | |
func tableView(_ tableView: UITableView, | |
estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat { | |
return 44.0 | |
} | |
func tableView(_ tableView: UITableView, | |
heightForRowAt indexPath: IndexPath) -> CGFloat { | |
return UITableViewAutomaticDimension | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment