I am using the \'swipe to delete\' functionality of the UITableView
.
The problem is I am using a customised UITableViewCell
which is create
I don't know of any way to "move the delete button 10px to the left". However, you can animate the custom contents of your table cell around the static position of the unmovable delete button by listening for the willTransitionToState:
message from a UITableViewCell
sub-class see here.
To quote the docs:
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.
What you are looking for is the UITableViewCellStateShowingDeleteConfirmationMask
value. This is one of those times where creating UITableViewCell subclass might be better, so from the controller you are just creating an instance of your custom cell. Then the cell can just adjust itself like animateLeft
and animateRight
and handle the inner workings of adjusting its own subviews.