MZBookshelfCollectionViewLayout

by m1entus

Bookshelf like iBooks layout for UICollectionView.

129 Stars 19 Forks Last release: Not found MIT License 6 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

MZBookshelfCollectionViewLayout

MZBookshelfCollectionViewLayout
is a collection view layout similar to iBooks for UICollectionView.

Interface

extern NSString *const MZBookshelfCollectionViewLayoutDecorationViewKind;

@class MZBookshelfCollectionViewLayout;

@protocol MZBookshelfCollectionViewLayoutDelegate @required

  • (CGSize)collectionView:(UICollectionView *)collectionView layout:(MZBookshelfCollectionViewLayout *)collectionViewLayout referenceSizeForDecorationViewForRow:(NSInteger)row inSection:(NSInteger)section;

@optional

  • (UIOffset)collectionView:(UICollectionView *)collectionView layout:(MZBookshelfCollectionViewLayout *)collectionViewLayout decorationViewAdjustmentForRow:(NSInteger)row inSection:(NSInteger)section; @end

@interface MZBookshelfCollectionViewLayout : UICollectionViewFlowLayout @end

Example Usage

- (void)viewDidLoad
{
    [super viewDidLoad];

MZBookshelfCollectionViewLayout *layout = (id)self.collectionView.collectionViewLayout;
[layout registerNib:[UINib nibWithNibName:@"MZBookShelfDecorationView" bundle:nil] forDecorationViewOfKind:MZBookshelfCollectionViewLayoutDecorationViewKind];

}

  • (CGSize)collectionView:(UICollectionView *)collectionView layout:(MZBookshelfCollectionViewLayout *)collectionViewLayout referenceSizeForDecorationViewForRow:(NSInteger)row inSection:(NSInteger)section { return CGSizeMake(collectionViewLayout.collectionViewContentSize.width, 30); }

  • (UIOffset)collectionView:(UICollectionView *)collectionView layout:(MZBookshelfCollectionViewLayout *)collectionViewLayout decorationViewAdjustmentForRow:(NSInteger)row inSection:(NSInteger)section { return UIOffsetMake(0, 0); }

Contact

Michał Zaborowski

  • http://github.com/m1entus
  • http://twitter.com/iMientus
  • http://twitter.com/inspace_io

License

MZBookshelfCollectionViewLayoutDelegate is available under the MIT license. See the LICENSE file for more info.

Bitdeli Badge

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.