Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. - (void)switchToSection:(NSInteger)section {
  2. if (section < [self numberOfSectionsInCollectionView:self.clothesCollectionView]) {
  3. [self.clothesCollectionView layoutIfNeeded];
  4. UICollectionViewLayoutAttributes *attributes = [self.clothesCollectionView layoutAttributesForSupplementaryElementOfKind:UICollectionElementKindSectionHeader
  5. atIndexPath:[NSIndexPath indexPathForRow:0 inSection:section]];
  6. [self.clothesCollectionView setContentOffset:CGPointMake(0, attributes.frame.origin.y - self.clothesCollectionView.contentInset.top)
  7. animated:YES];
  8. }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement