-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Description
cache the height to model, may is anythings you want
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: cellIdForMessage(msg:array[safe: indexPath.row]), for: indexPath)
if let model = array[safe: indexPath.row] {
cell.reloadData(data: model as Any)
if (model.cellHeigth > CGFloat(0)) == false {
let size = cell.contentView.systemLayoutSizeFitting(CGSize(width: YYScreenSize().width, height: 0), withHorizontalFittingPriority: .required, verticalFittingPriority: .fittingSizeLevel)
model.cellHeigth = size.height
}
}
return cell;
}
Metadata
Metadata
Assignees
Labels
No labels