I have linked the UITextView to my custom cell class and when I call #dequeueReusableCell#, I assign it to constant cell as my CustomCellClass.
I cannot quite figure out why this happens. When I checked the variables section next to the log console, it says everything is nil.
However when I open up theTableViewCell, I found "_imageView" and "_textLabel" and if I assign my values to these, it shows up. Even then, I cannot find UITextView there.
Thanks for any help.
Code for custom Cell Class:
class PostCell: UITableViewCell { @IBOutlet weak var postImageView: UIImageView! @IBOutlet weak var postTextView: UITextView! @IBOutlet weak var postName: UILabel! } Function where I assign the values:
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = self.tableView.dequeueReusableCell(withIdentifier: cellReuseIdentifier , for: indexPath) as! PostCell let cellPost = self.posts[indexPath.row] cell.textLabel?.text = "Hola" cell.postName.text = cellPost._text cell.imageView?.image = UIImage(named: "UV_Logo-12") return cell } In the above code, textLabel and imageView are not the var names in the custom class.
viewDidLoad Function:
@IBOutlet weak var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. queryPosts() tableView.delegate = self tableView.dataSource = self self.tableView.register(PostCell.self, forCellReuseIdentifier: cellReuseIdentifier) } 

PostCellin Interface Builder? Are the outlets connected?