ios - Cannot retrieve transition state from cell when rearranging is enabled -



ios - Cannot retrieve transition state from cell when rearranging is enabled -

i have uitableviewcontroller within navigation controller. i'm retrieving state of cells in class of uitableviewcell method

- (void)willtransitiontostate:(uitableviewcellstatemask)state;

which works fine, when enable rearranging table view with

- (void)tableview:(uitableview *)tableview moverowatindexpath:(nsindexpath *)fromindexpath toindexpath:(nsindexpath *)toindexpath;

the state has values 0, 2147483649, 2147483650 & 2147483651 instead of 0, 1, 2 & 3.

is there way resolve issue or missing something?

the supported states below:

uitableviewcellstatedefaultmask (0), uitableviewcellstateshowingeditcontrolmask (1), uitableviewcellstateshowingdeleteconfirmationmask (2), , uitableviewcellstateshowingeditcontrolmask | uitableviewcellstateshowingdeleteconfirmationmask (3).

so these states can confirmed using below code :

below works of transition states , handles swipe delete gesture well.

- (void)willtransitiontostate:(uitableviewcellstatemask)state { [super willtransitiontostate:state]; if (!cell.editing && !cell.showingdeleteconfirmation) { // 0 - uitableviewcellstatedefaultmask } else if (cell.editing && !cell.showingdeleteconfirmation) { // 1 - uitableviewcellstateshowingeditcontrolmask } else if (!cell.editing && cell.showingdeleteconfirmation) { // 2 - uitableviewcellstateshowingdeleteconfirmationmask } else if (cell.editing && cell.showingdeleteconfirmation) { // 3 - uitableviewcellstateshowingeditcontrolmask | uitableviewcellstateshowingdeleteconfirmationmask } }

ios xcode uitableview state

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -