KILabel icon indicating copy to clipboard operation
KILabel copied to clipboard

Fix issue with indexPath in didSelectRowAtIndexPath when a cell contains KILabel

Open asenchuk opened this issue 9 years ago • 3 comments

Related to #30

It looks like copy-paste issue when a chunk of code at the touchesEnded was copied from touchesBegan and after super's touchesEnded super's touchesBegan is being called.

Main.storyboard was updated to make a cell selectable. KILabelTableViewController.m updated with logging so you can check issue.

To reproduce the issue revert my changes in KILabel.m and try the following steps:

  1. tap first cell - indexPath is 0-0 (correct)
  2. tap second cell - indexPath is still 0-0 (wrong)
  3. tap second call again - indexPath is 0-1 (correct)
  4. tap first cell - indexPath is 0-1 (wrong)
  5. tap first cell again - indexPath is 0-0 (correct)

Hope you will check this PR asap because it's very useful pod.

ADDED: fix for the crash caused by adding nil color to a dict

asenchuk avatar Oct 13 '15 08:10 asenchuk

... and. nothing?

asenchuk avatar Oct 26 '15 11:10 asenchuk

I fixed the issue by removing for following code from "- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event.

else { [super touchesBegan:touches withEvent:event]; }

I guess the author copied code from "- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event" by mistake.

mobilefellow avatar May 16 '16 16:05 mobilefellow

@mobilefellow thank you. I have just wasted two hours on this, taking my project (quite large) apart and going more crazy every minute. It was one of the most bizarre and random bugs I have seen this year. I'm so happy it works now.

nazywamsiepawel avatar Mar 29 '17 16:03 nazywamsiepawel