LoginSignup
11
11

More than 5 years have passed since last update.

UItableViewで編集モードにしつつタップも有効にする

Posted at

IMG_5267.PNG
このようなUI(あんまりよろしくないですが)は、見ての通りUItableviewに

[self.tableView setEditing:YES animated:YES];

されているのですが、これをすると困ったことに

tableView: didSelectRowAtIndexPath:

が呼ばれなくなります。…ので要するにタップ出来なくなります。
当初、UITapGestureRecognizerで強制的に呼んでいたのですがそうすると今度はデリートボタンの反応がとても悪くなります。
どうすりゃええんやーと思ってリファレンス読み直したらちゃんと

self.tableView.allowsSelectionDuringEditing=YES;

っていうのがありました(汗
ってオチです

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