iphone - Determine whether UITableViewCell is editing from "swipe" or "self.editButton" -
i'm trying determine whether uitableviewcell subclass in edit mode user's swipe (in case don't need indent subviews) or user pressing "edit" button associated uitableviewcontroller. (in case do.)
i know it's possible cell's perspective, since self.textlabel
view automatically indents properly. have tried:
-(void)layoutsubviews { [super layoutsubviews]; cgrect labelframe = self.textlabel.frame; labelframe.origin.x += 5; mycustomuilabel.frame = labelframe; }
but custom label not indent. (though self.textlabel
view does?)
i avoid following:
- providing cells reference parent table.
- overriding methods in uitableviewcontroller class let cells know whether being edited individually or entire table editing.
you can override willtransitiontostate:
in uitableviewcell
subclass. when "edit" button pressed state uitableviewcellstateshowingeditcontrolmask
(=1) , when swiping uitableviewcellstateshowingdeleteconfirmationmask
(=2).
Comments
Post a Comment