【发布时间】:2016-02-28 14:08:24
【问题描述】:
我正在设计一个包含 3 个自定义单元格的表格视图。 我想通过添加独特的配件类型来定制它们。 我用静态单元格创建了一个 tableViewController。每个单元格我都写了一个特殊的标识符和特殊的类。
对于 3 个自定义单元格,我的 tableView 基金应该是什么样子?
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let CityCellIdentifier = "CityTableViewCell"
let cell = tableView.dequeueReusableCellWithIdentifier(CityCellIdentifier, forIndexPath: indexPath) as! CityTableViewCell
// Configure the cell...
return cell
}
我应该为此创建三个单元格变量吗?
【问题讨论】:
-
他的问题很快,你把他链接到一个客观的c问题
-
您的意思是 tableview 最多包含 3 个(不同的)单元格,还是 tableview 会显示多个可以是 3 种不同类型的单元格?
-
@Kymer 我的意思是第一个选项
标签: ios swift uitableview