xibcell注册并使用

/// 注册cell

   let nib = UINib(nibName: "ServiceReportDetailTableViewCell", bundle: nil)
    tableView.register(nib, forCellReuseIdentifier: "ServiceReportDetailTableViewCell")

//使用

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: "ServiceReportDetailTableViewCell") as! ServiceReportDetailTableViewCell
    return cell
}

你可能感兴趣的:(xibcell注册并使用)