I have a custom tableview controller which has 3 sections.
1 first section has a collection view. Now I want to add text (which length is less than 1000 characters) to a first cell of 2nd section.
I plan to make that cell style basic, so I can add title.
- How can I call
cell.title.text = myString
?
I mean I want something like
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if tableView.section == 2 and cell == 1 {
cell.title.text = myString
return cell
}
}
- because
myString
length is between 0 ~ 1000 words. How can I change the height of cell base on the length ofmyString
?
Thanks