本文介绍: 1.dequeueReusableCell(withIdentifier:)方法不需要注册 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { var cell:UITableViewCell! if let cell1 = tableView.dequeueReusableCell(withIdentifier: “cell
1.dequeueReusableCell(withIdentifier:)方法不需要注册
2.dequeueReusableCell(withIdentifier:for:)需要注册,返回的的是default类型的cell,如果想返回其他类型的cell,只能用第一个方法
3.我的另外一篇博客:
其他相关博客:
swift中如何正确设置UITableViewCell的UITableViewCellStyle样式属性!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。