Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-9973]iOS: Fix TableView's longpress event. #2597

Merged
merged 1 commit into from Jul 19, 2012
Merged

[TIMOB-9973]iOS: Fix TableView's longpress event. #2597

merged 1 commit into from Jul 19, 2012

Conversation

vishalduggal
Copy link
Contributor

Test is in JIRA

Basically unless you click a row the row,rowData properties must be nil.
If you click a section header or footer section should not be nil but row and rowData must be nil.
If you click outside the section bounds section,row,rowData must be nil

}
}
NSDictionary *event = [NSDictionary dictionaryWithObjectsAndKeys:
NUMBOOL(NO),@"detail",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should include section data.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section responds to a longpress on a tableView that is outside the section bounds (Like the tableView header or footer). So the section piece was left out of the event.

From the docs for indexPathForRowAtPoint:
An index path representing the row and section associated with point or nil if the point is out of the bounds of any row.

Observed behavior is that when the point belongs to sectionHeader or Footer it returns a false indexPath belonging to a row. Also observed that when the point belongs to the header of the first section indexPath is nil. The first special case is handled in the next block. The second special case is handled in the block above. The event generated here is for when indexPath is truly nil and does not correspond to a section or row.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that makes sense.

@sptramer
Copy link
Contributor

Code reviewed, please address comments.

@sptramer
Copy link
Contributor

Code reviewed, APPROVED

@sptramer
Copy link
Contributor

Functional tested, iPhone Sim 5.1. APPROVED

sptramer pushed a commit that referenced this pull request Jul 19, 2012
[TIMOB-9973]iOS: Fix TableView's longpress event.
@sptramer sptramer merged commit 042506f into tidev:master Jul 19, 2012
@farfromrefug
Copy link
Contributor

That pull request made complex tableviews a lot slower!
I can see it on this example
https://jira.appcelerator.org/browse/TIMOB-5429

@vishalduggal vishalduggal deleted the timob-9973 branch October 27, 2014 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants