Disclaimer: I know it\'s not a best practice to tweak that kind of stuff because it may break as Apple decides to change its internal behaviour.
There are s
The reason you don't see the view inside layoutSubviews or willTransitionToState: is that the delete button view does not exist yet or it is not part of the view hierarchy yet.
In order to "see" it you need to postpone a little the code that browses the view hierarchy, and by that allowing the OS to create/add the view in the meantime:
- (void)willTransitionToState:(UITableViewCellStateMask)state
{
[super willTransitionToState:state];
if (state & UITableViewCellStateShowingDeleteConfirmationMask)
{
[self performSelector:@selector(findDeleteButtonViewThroughViewHierarchy:) withObject:self.subviews afterDelay:0];
}
}
Note this is a fragile solution since it is based on internal implementation of Apple that might change any time.
See here an (almost) complete example:
Customizing iOS 7 Delete button