Created
November 10, 2017 12:22
-
-
Save yabenatti/56852de86450e0ec1bd5872a6490b187 to your computer and use it in GitHub Desktop.
MiniCursoIFSPSwiftTableViewDataSource
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 HomeViewController : UITableViewDataSource { | |
//Métodos obrigatórios | |
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
return self.animalsArray.count | |
} | |
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
guard let cell = tableView.dequeueReusableCell(withIdentifier: homeCellIndentifier, for: indexPath) as? HomeTableViewCell else { | |
fatalError("Cannot create Home Table View Cell") | |
} | |
cell.initWithAnimal(animal: self.animalsArray[indexPath.row]) | |
return cell | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment