importReusableCell_iOS
tableView.register(CustomCell.self) // Register Cells with easeextensionCustomCell: ReusableCell {} // Make your custom cellslet cell: CustomCell = tableView.dequeueReusableCell(for: indexPath) // Instantiate your cells// In the cell:extensionCustomCell: ReusableCellKind {// make your subclass conform to the protocolopen class var defaultReuseIdentifier:String {return "\(TextCell.self)" }
}
Example 2:
importCommonCellimportWithfunctableView(_tableView: UITableView, cellForRowAtindexPath: IndexPath) -> UITableViewCell {
returnwith(tableView.dequeueReusableCell(indexPath: indexPath) as TextCell) {
$0.backgroundColor= .clear$0.data= rowData[indexPath.row] // populate cell with data
}
}