mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-24 18:42:47 +02:00
HomeVC: Automatically scrollback to the left every time the screen is displayed
This commit is contained in:
@@ -72,6 +72,8 @@
|
||||
recentsDataSource.areSectionsShrinkable = NO;
|
||||
[recentsDataSource setDelegate:self andRecentsDataSourceMode:RecentsDataSourceModeHome];
|
||||
}
|
||||
|
||||
[self moveAllCollectionsToLeft];
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
@@ -84,6 +86,24 @@
|
||||
[super destroy];
|
||||
}
|
||||
|
||||
- (void)moveAllCollectionsToLeft
|
||||
{
|
||||
// Scroll all rooms collections to their beginning
|
||||
for (NSInteger section = 0; section < [self numberOfSectionsInTableView:self.recentsTableView]; section++)
|
||||
{
|
||||
UITableViewCell *firstSectionCell = [self.recentsTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:section]];
|
||||
if (firstSectionCell && [firstSectionCell isKindOfClass:TableViewCellWithCollectionView.class])
|
||||
{
|
||||
TableViewCellWithCollectionView *tableViewCell = (TableViewCellWithCollectionView*)firstSectionCell;
|
||||
|
||||
if ([tableViewCell.collectionView numberOfItemsInSection:0] > 0)
|
||||
{
|
||||
[tableViewCell.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0] atScrollPosition:UICollectionViewScrollPositionLeft animated:NO];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Override RecentsViewController
|
||||
|
||||
- (void)displayList:(MXKRecentsDataSource *)listDataSource
|
||||
|
||||
Reference in New Issue
Block a user