0
ボタン、タイトルを表示するテーブルビューが1つあります。今私はcell.And上の画像でセルをチェックする/チェックを外す必要があります最後に何をチェックしてイメージのセルのタイトルは私が印刷する必要がありますか?複数のチェックボックスを選択し、チェックされた行のタイトルだけを印刷する
私のコード:
var selectedIndexPathArray = Array<NSIndexPath>()
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! BlockedTableViewCell
let pending = allnames?[indexPath.row]
cell.NameLabel.text = pending?.name
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
selectedIndexPathArray.append(indexPath as NSIndexPath)
tableView.reloadData()
}
マイセルチェックボックスのイメージ名:'checked.png' 'unchecked.png'
セルを選択したときにセルのタイトルを印刷しますか? – Phyber
はい、チェックしたいボタンメイジを変更する必要があります。複数のチェックボックスも選択されています。チェックセルのタイトルだけを印刷する必要があります。(注:最初にチェックして、このタイトルとすべては印刷されません) –
あなたのUITableViewCell用のカスタムクラスを作成することができます。 – Phyber