LoginSignup
1
1

More than 3 years have passed since last update.

UITableViewを使った複数選択の仕方

Last updated at Posted at 2019-09-05

UITableViewでの複数選択

普段salesforceを使ってるのですが家に帰って勉強がてらswiftを
ぽちぽちしてるので知ったことを備忘録含めて共有します。

UITableViewController
class UITableViewController: UITableViewDelegate,UITableViewDataSource {

    @IBOutlet weak var trainingView: UITableView!
    override func viewDidLoad() {
        super.viewDidLoad()

    trainingView.delegate = self
    trainingView.dataSource = self
    trainingView.allowsMultipleSelection = true

    }

trainingView.allowsMultipleSelection = true

が複数選択を可能にしてくれます。
これ以外にも

allowsMultipleSelectionDuringEditing

はEditモードの時に複数選択を可能にする物です。

簡単ですがこんな感じで動きます。

よかったら参考にしてみてください。

1
1
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
1
1