小编Rev*_*goL的帖子

如何在 SWIFT 3 中对 UITableView 执行部分和单元格的动态创建

我有一个示例代码,但不会显示每节的行,因为numberOfRowsInSection不再存在SWIFT 3

我目前有 ff 代码:

let section = ["pizza", "deep dish pizza", "calzone"]

let items = [["Margarita", "BBQ Chicken", "Pepperoni"], ["sausage", "meat lovers", "veggie lovers"], ["sausage", "chicken pesto", "prawns", "mushrooms"]]

override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? {

    return self.section[section]

}

override func numberOfSections(in tableView: UITableView) -> Int {
    return self.section.count
}

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: "tableCell", for: indexPath)

    // Configure the …
Run Code Online (Sandbox Code Playgroud)

dynamic uitableview ios swift swift3

2
推荐指数
1
解决办法
3477
查看次数

标签 统计

dynamic ×1

ios ×1

swift ×1

swift3 ×1

uitableview ×1