Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableView : detecting click on '-' button in edit mode

On my iphone app, I have a UITableView in edit mode, containing custom UITableViewCell. I would like to detect when user has clicked on the left button of each cell (minus circular red button, the one that is animated with a rotation), just before the "Delete" button appears.

I would like to be able to change my cell content in that case...

Is that possible ?

Thanks !

like image 538
synthez84 Avatar asked Dec 22 '22 04:12

synthez84


1 Answers

You can subclass UITableViewCell that implements -willTransitionToState: and/or -didTransitionToState: methods.

willTransitionToState: Subclasses of UITableViewCell can implement this method to animate additional changes to a cell when it is changing state. UITableViewCell calls this method whenever a cell transitions between states, such as from a normal state (the default) to editing mode. The custom cell can set up and position any new views that appear with the new state. The cell then receives a layoutSubviews message (UIView) in which it can position these new views in their final locations for the new state. Subclasses must always call super when overriding this method.

like image 152
Vladimir Avatar answered Jan 06 '23 15:01

Vladimir