私はtableViewに2つのセクションを持ち、multipleSelectionをtrueにしています。 セクション1で1番目のセルを選択してからスクロールダウンすると、2番目のセクションの1番目のセルがすでに選択されていて、ランダムなスクロールがいくつかシャッフルされています。TableView AccessoryTypeチェックマークシャッフル
また、私はcheckmark
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.cellForRow(at: indexPath)?.accessoryType = .checkmark
}
func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) {
tableView.cellForRow(at: indexPath)?.accessoryType = .none
}
@simalome選択/選択解除ごとにtableViewをリロードする正しい方法はありますか? – Nitesh
それは単純です:)。代わりに 'tableView.reloadRows(at:[indexpath]、with:.none)'を使うことができます。 – simalone