Swift 写纯洁的TableviewCell

时间:2023-03-08 16:17:04
Swift 写纯洁的TableviewCell

let initIdentifier = "员工"

var cell = tableView.dequeueReusableCell(withIdentifier: initIdentifier);

if (cell == nil)

{

cell = UITableViewCell(style: UITableViewCellStyle.default, reuseIdentifier: initIdentifier)

}

let model:EmployeeModel = (self.data![indexPath.row] as EmployeeModel);

cell?.textLabel?.text = model.employeeName;

cell?.textLabel?.textColor = UIColor.init(colorLiteralRed: 66/255.0, green: 174/255.0, blue: 211/255.0, alpha: 1.0);

cell?.textLabel?.font = UIFont.systemFont(ofSize: 20);

return cell!