LoginSignup
0
0

More than 1 year has passed since last update.

TableViewプロパティ詰め合わせ

Posted at

はじめに

TableViewで使えるプロパティ、調べれば調べるほどごろごろ出てきます。
そこで、override.func viewDidLoad内に置くだけですぐに使えるプロパティを紹介しますので、是非使ってみて下さい。

ViewController
        //空白のセルの表示を設定。デフォルトで空白は表示されない
        tableView.tableFooterView = UIView(frame: .zero)
        // trueでセルの選択、falseで選択無効※isEditingモードでは無効になる
        tableView.allowsSelection = true
        //trueで複数選択、falseで単一選択※isEditingモードでは無効になる
        tableView.allowsMultipleSelection = true
        //編集を可能にする
        tableView.isEditing = true
        //セルの選択が出来る様にになる※isEditingモードで有効になる
        tableView.allowsSelectionDuringEditing = true
        //左にチェックマークが付く※isEditingモードで有効になる 同時に複数選択可能になる
        tableView.allowsMultipleSelectionDuringEditing = true

このプロパティをtrueにしたりfalseにしたり色々試してみる事でtableViewの理解が深まるので遊んでみて下さい!!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0