Table View Didselectrowatindexpath, Only Works After Selecting Second Click

Table view didSelectRowAtIndexPath, only works after selecting second click

That is because you implemented didDeselectRowAtIndexPath instead of
didSelectRowAtIndexPath.

UITableView didSelectRowAtIndexPath sometimes called after second tap

Try this.

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
dispatch_async(dispatch_get_main_queue(), {
self.performSegueWithIdentifier("homeToDetail", sender:self)
})
}

This is a bug in iOS 8, I think. UITableViewCell selection Storyboard segue is slow - double tapping works though

iphone - didSelectRowAtIndexPath: only being called after long press on custom cell

same problem happened with me because I have added a tap gesture recogniser over it.
If you have used any gesture recognizer try removing it and check if it causing the problem.

EDIT: Solution as commented by the Ali:
If you have used tap gesture you can use [tap setCancelsTouchesInView:NO];

didDeselectRowAtIndexPath only called after pressing another cell

Are you confused with didSelectRowAtIndexPath and didDeselectRowAtIndexPath?

The latter will only be called if it's deselected, hence why it's called after you select another cell.

If you want to call the didDeselectRowAtIndexPath, then add the method deselectRowAtIndexPath in didSelectRowAtIndexPath and it will deselect right way.

UITableView didSelectRowAtIndexPath: not being called on first tap

Any chance you accidentally typed didDeselectRowAtIndexPath?

UITableView and presentViewController takes 2 clicks to display

Check this out: https://devforums.apple.com/thread/201431
If you don't want to read it all - the solution for some people (including me) was to make the presentViewController call explicitly on the main thread:

dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:myVC animated:YES completion:nil];
});

Probably iOS7 is messing up the threads in didSelectRowAtIndexPath.

Swift ios didSelectItemAt not called until second click

You use didDeselectItemAt instead of

func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) { }

use

func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { }

Issue with UITableView: Action only works every second time

Change didDeselectRowAt to didSelectRowAt



Related Topics



Leave a reply



Submit