0

This is start layout:

enter image description here

And this is how it looks after I set editing table to true:

enter image description here

When I scroll my table down and up this looks ok:

enter image description here

How to update constraints on these cells once I set editing to true?

THIS QUESTION IS NOT DUPLICATD AS IT WAS MARKED. PAY ATTENTION PLEASE.

Bartłomiej Semańczyk
  • 56,735
  • 45
  • 213
  • 327
  • You can implement `willTransitionToState` and/or `didTransitionToState` in your UITableViewCell subclass – Paulw11 Sep 05 '15 at 22:24
  • and then what should I put inside that method? – Bartłomiej Semańczyk Sep 05 '15 at 22:51
  • Probably something like `[self setNeedsLayout]` – Paulw11 Sep 05 '15 at 23:31
  • Method is called, but neither `setNeedsLayout`, neither `setNeedsUpdateConstraints`, `setNeedsDisplay` didn't solve this. Still not refreshed. – Bartłomiej Semańczyk Sep 06 '15 at 07:05
  • Does the height of the cell change in editing mode? If so then you probably need to reload the cell – Paulw11 Sep 06 '15 at 09:44
  • Yes, the height changes. Where can I reload these cells? What method implements action just after button to edit did appear? – Bartłomiej Semańczyk Sep 06 '15 at 09:49
  • So this seems to be the answer - http://stackoverflow.com/questions/460014/can-you-animate-a-height-change-on-a-uitableviewcell-when-selected - basically include these two lines of code where you activate editing mode on your table – Paulw11 Sep 06 '15 at 10:02
  • Ok, but how to detect if that line did invoke: `tableView.setEditing(true, animated: true)`? Because I have to call `beginUpdates()` AFTER this method is finished. is there any place for this? – Bartłomiej Semańczyk Sep 06 '15 at 10:11
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/88921/discussion-between-paulw11-and-bartlomiej-semanczyk). – Paulw11 Sep 06 '15 at 10:36

0 Answers0