samvermette samvermette - 1 year ago 192
iOS Question

UITableView beginUpdates/endUpdates callback

I'm making changes to a tableView using a beginUpdates/endUpdates block. Throughout the way I need to update a drop shadow so that it reflects the tableView's current composition.

I tried setting up KVO for the tableView's

but it's only called on
, once the animation has finished. What I want is for it to be called every time
changes (even if it's by only a pixel). Is there any way to achieve this?

Answer Source

Sorry to say, I don't think you can do this. When you make changes to the table in after beginUpdates has been called the changes are animated as a single animation after endUpdates. There are no animation callbacks during these animations. I haven't tried this so don't know if it would work well for this but you could try nesting beginUpdates and endUpdates and updating your shadow after each endUpdates.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download