Guest User

Untitled

a guest
Jan 19th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. 30 libdyld.dylib 0x00000001107a7575 start + 1
  2.  
  3. override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
  4. let cellIdentifier = "CharacterTableViewCell"
  5. guard let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) as? CharacterTableViewCell else {
  6. fatalError("The dequeued cell is not an instance of CharacterTableViewCell")
  7. }
  8.  
  9. let char = characterList[indexPath.row]
  10.  
  11. cell.characterNameLabel.text = char.name
  12. cell.raceLabel.text = char.race
  13. cell.classLabel.text = char.cclass
  14. cell.backgroundLabel.text = char.background
  15. cell.photoImageView.image = char.photo
  16.  
  17. // Configure the cell...
  18.  
  19. return cell
  20. }
  21.  
  22. private func loadSampleCharacters(){
  23. let photo1 = UIImage(named: "human")
  24. guard let character1 = Character(name: "Eravan", race: "Human", cclass: "Paladin", background: "Soldier", photo: photo1) else {
  25. fatalError("Unable to initiate Character 1")
  26. }
  27.  
  28. characterList += [character1]
  29. }
Add Comment
Please, Sign In to add comment