Skip to content

Commit

Permalink
Merge branch 'main' into feature/update-vue-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
open-hippy authored Jan 12, 2024
2 parents ab37b38 + 6893636 commit 6bc34be
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,19 @@ - (BOOL)bounces {
}

- (void)setShowScrollIndicator:(BOOL)show {
[self.collectionView setShowsVerticalScrollIndicator:show];
if (self.horizontal) {
[self.collectionView setShowsHorizontalScrollIndicator:show];
} else {
[self.collectionView setShowsVerticalScrollIndicator:show];
}
}

- (BOOL)showScrollIndicator {
return [self.collectionView showsVerticalScrollIndicator];
if (self.horizontal) {
return [self.collectionView showsHorizontalScrollIndicator];
} else {
return [self.collectionView showsVerticalScrollIndicator];
}
}

- (void)setScrollEnabled:(BOOL)value {
Expand Down Expand Up @@ -384,6 +392,7 @@ - (CGFloat)collectionView:(UICollectionView *)collectionView

- (void)setHorizontal:(BOOL)horizontal {
if (_horizontal != horizontal) {
BOOL previousShowScrollIndicator = self.showScrollIndicator;
_horizontal = horizontal;
UICollectionViewFlowLayout *layout = (UICollectionViewFlowLayout *)self.collectionView.collectionViewLayout;
layout.scrollDirection = horizontal ? UICollectionViewScrollDirectionHorizontal : UICollectionViewScrollDirectionVertical;
Expand All @@ -395,6 +404,9 @@ - (void)setHorizontal:(BOOL)horizontal {
[self.collectionView setAlwaysBounceVertical:YES];
[self.collectionView setAlwaysBounceHorizontal:NO];
}
if (self.showScrollIndicator != previousShowScrollIndicator) {
[self setShowScrollIndicator:previousShowScrollIndicator];
}
}
}

Expand Down

0 comments on commit 6bc34be

Please sign in to comment.