UX Rework - Add home page:

Scroll to the top the section when the user taps on section header.

https://github.com/vector-im/riot-meta/issues/75
This commit is contained in:
Giom Foret 2017-05-12 12:18:29 +02:00
parent 5162517122
commit f425541761

View file

@ -113,6 +113,12 @@
UIView *view = gestureRecognizer.view;
NSInteger section = view.tag;
// Scroll to the top this section
if ([self.recentsTableView numberOfRowsInSection:section] > 0)
{
[self.recentsTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:section] atScrollPosition:UITableViewScrollPositionTop animated:YES];
}
// Scroll to the beginning the corresponding rooms collection.
UITableViewCell *firstSectionCell = [self.recentsTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:section]];
if (firstSectionCell && [firstSectionCell isKindOfClass:TableViewCellWithCollectionView.class])