It is probably not working as you expect because willBeginEditingRowAtIndexPath:
is called before the editing starts.
If you want to check while in another method you need the editing
property:
@property(nonatomic, getter=isEditing) BOOL editing
If you want to do something when the 'Edit' button is pressed you need to implement the setEditing method:
- (void)setEditing:(BOOL)editing animated:(BOOL)animated
Which you'll find in UIViewController
. (Well, that's the most likely place; there are others.)
Swift
Use below code accordingly:
open var isEditing: Bool // default is NO. setting is not animated.
open func setEditing(_ editing: Bool, animated: Bool)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…