[TIMOB-20139] iOS Peek & Pop: Events do not include itemIndex, sectionIdex, itemId for TableView
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-12-16T19:58:08.000+0000 |
Affected Version/s | Release 5.1.1 |
Fix Version/s | Release 5.4.0 |
Components | iOS |
Labels | 3dtouch, peekandpop, qe-5.4.0, tableview |
Reporter | Jason Kneen |
Assignee | Hans Knöchel |
Created | 2015-12-14T12:56:51.000+0000 |
Updated | 2016-06-09T18:09:18.000+0000 |
Description
When attempting to use Peek and Pop with a Tableview previewContext property, no index properties are provided when a row is clicked, making it impossible to display row-specific information / content.
Code missing TableView implementation:
https://github.com/appcelerator/titanium_mobile/blob/a8b6440f99f7d1eb945ba92a1fe3e6602fbcc1ec/iphone/Classes/TiPreviewingDelegate.m#L112-L160
Looks like we forgot to implement TIMOB-19763 for TableViews as we did for ListViews.
We didn't implement the features because we don't support new features for the (legacy)
Ti.UI.TableView
anymore. Developers should useTi.UI.ListView
for new features like peek and pop.There are sometimes good reasons for using a tableview and to limit the features to list view when it *appears* that it's easy enough to implement with a tableview (I've got a basic version working by using touch start to get the index) doesn't make any sense to me. Basically this is forcing us to use listviews for apps where we want peek and pop but that might not be the right list based solution for us -- apparently the fix is quite easy?
Well, we did implement it in part: https://github.com/appcelerator/titanium_mobile/blob/a8b6440f99f7d1eb945ba92a1fe3e6602fbcc1ec/iphone/Classes/TiPreviewingDelegate.m#L122-L129 And do document it (by inheritance) here: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView-property-previewContext And since there's still quite some use cases which ListView doesn't support I think we do need to add this to TableView as well.
The only reason it's in the docs is because we apply it to every TiViewProxy by default from which the table view inherits. We could plan it for some later release, but since we are after code freeze for 5.2, I'm not sure if we should hype this up. The
Ti.UI.TableView
will most likely be deprecated in the future, so we encourage developers to migrate the API since 3 years now :-)So because of something that could happen "in the future" you're not going to solve this problem now?
No, because it's no critical bug right now + we provide an API to fix it on the developer side + we are after code freeze for 5.2.0. Thats why.
wow. ok. closing ticket.
Relax, all good :-) Just means, that it cannot be addressed right now, but for a 5.2.1 Release (or 5.2.0 backport). Since I'm off in december, maybe [~apetkov] can help?
Appc has been going to deprecate TableView for about 3 years now. But keep in mind that TableView and ListView are not interchangeable components. Switching from TableView to ListView can involve significant re-architecting of your app (I know, I just did it and it was a royal pain in the you-know-what). There are many things you can do with TableView that you can't do with ListView. For small lists, the speed advantage of ListView is often not worth the effort compared to the coding and conceptual simplicity of the direct-view-access nature of TableView.
[~jasonkneen] Hello , I can understand you're fustrated ,however we are currently at code freeze as we have a release coming out very soon. This change will be added to the following release after that, i apologies for the inconvenience this might have caused to your app development.
PR: https://github.com/appcelerator/titanium_mobile/pull/7580 Docs not updated, since we strongly recommend to use the
Ti.UI.ListView
to use Peek and Pop.But for what reason? Performance or just because it doesn't work out-of-the-box on TableView? I've got an app working with existing TableViews, and peek and pop and it's fine -- I had to do a workaround if I wanted to do the peek against the tableview itself -- using touch start to set the index before the peek -- otherwise it's possible to do the peek against the tableview row much like the mail app does. Thanks for the PR -- assuming this will work fine now for TableViews.
[~hansknoechel] You realize that neither http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView nor http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ListView state that TableView is in a need-to-be-fixed-only state or that ListView is recommended in place of TableView. It's only with a good bit of digging through the guides that one might find details of your recommendation to use ListView. If you're going to deprecate a component, which you're essentially doing here, that should be clearly documented in the API docs.
FT and CR approved. Thanks Hans!
Verified as fixed as an improvement. Tested on: iPhone 6s Plus (9.3.1) Mac OSX El Capitan 10.11.4 Studio: 4.7.0.201606070951 Ti SDK: 5.4.0.v20160608165242 Appc NPM: 4.2.7-2 Appc CLI: 5.4.0-13 Xcode 7.3 Node v0.12.7 *Closing Ticket.*