• Stars
    star
    513
  • Rank 86,178 (Top 2 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 10 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

UICollectionViewLayout for displaying cells in a semi-circle with a nice fish eye effect

AWCollectionViewDialLayout

UICollectionViewLayout for displaying cells in a semi-circle with a nice fish eye effect.

Very handy for quickly browsing items with your left thumb without having some of the content hidden behind your finger while you scroll.

Demo Gif


####Initialize Layout

// Radius : The radius of your circle
// Angular spacing: Angle between items (deg)
// Cell Size: Size of your cell
// Alignment: Supports 2 Types: WHEELALIGNMENTLEFT and WHEELALIGNMENTCENTER
// X-Offset: To translate the circle along the x-axis

AWCollectionViewDialLayout *dialLayout = [[AWCollectionViewDialLayout alloc] initWithRadius:300.0  andAngularSpacing:18.0 andCellSize:CGSizeMake(240, 100) andAlignment:WHEELALIGNMENTCENTER andItemHeight:100  andXOffset:70];

####Enable Snap Mode

[dialLayout setShouldSnap:YES];

####Programmatically scroll to item at index

Use the cell_height variable you used to initialize the CollectionViewLayout and multiply it by the IndexPath.item

// Scroll to item at indexPath (0,2)
 [self.collectionView setContentOffset:CGPointMake(0, cell_height * 2) animated:YES];

Flip Horizontally

You can set the flip option to YES if you want to display your items on the right side of the CollectionView.

[dialLayout setShouldFlip:YES];