我怎麼能忽略數組的第一個項目時,在TableView中顯示?忽略數組中第一項的UITableView - 斯威夫特
我要的是忽略的第一個項目時,在一個UITableView呈現,我不想刪除它只是不TableView中表現出來。
下面的代碼示出了從在TableView中所述陣列的所有項目。
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return lists.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "listCell", for: indexPath)
let data = lists[indexPath.row]
cell.textLabel!.text = data.listName
return cell
}
你沒有足夠的展示代碼。顯示'numberOfRowsInSection'。 – matt
更新後。謝謝。 –
爲什麼不擁有主表以及表視圖數據源實際使用的數據模型? – rmaddy