ios - IOS7 Table view cell touching delay with cell property UITableViewCellSelectionStyleNone -


i want make custom table view cell this.

  • if cell.selectionstyle = uitableviewcellselectionstyledefault, there's no delay when touching title label's background color disappeared.

  • if cell.selectionstyle = uitableviewcellselectionstylenone, title label's background color fine, there's touching delay present modal vc. in advance!

you can implement this, under uitableviewdelegate method

- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath {      uitableviewcell *cell = [tableview cellforrowatindexpath:indexpath];      switch (cell.selectionstyle) {          case uitableviewcellselectionstylenone:              // making delay nstimer             [nstimer scheduledtimerwithtimeinterval:1.0 target:self selector:@selector(trigger:) userinfo:cell repeats:no];             break;          case uitableviewcellselectionstyledefault:              // changing labels color             [cell.textlabel setbackgroundcolor:[uicolor whitecolor]];             break;          default:             break;     }  }  - (void)trigger:(id)timer {      uitableviewcell *cell = (uitableviewcell *)[timer userinfo];      // _yourmodelcontroller destination controller     [self presentviewcontroller:_yourmodelcontroller animated:yes completion:null]; } 

but wont advice decision making based on selectionstyle property.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -