Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

UICollectionView-ARDynamicHeightLayoutCell

Automatically UICollectionViewCell size calculating.

Subscribe to updates I use UICollectionView-ARDynamicHeightLayoutCell


Statistics on UICollectionView-ARDynamicHeightLayoutCell

Number of watchers on Github 517
Number of open issues 5
Average time to close an issue 3 months
Main language Objective-C
Average time to merge a PR about 6 hours
Open pull requests 0+
Closed pull requests 2+
Last commit about 3 years ago
Repo Created over 4 years ago
Repo Last Updated over 1 year ago
Size 28.1 MB
Organization / Authoraugustrush
Contributors2
Page Updated
Do you use UICollectionView-ARDynamicHeightLayoutCell? Leave a review!
View open issues (5)
View UICollectionView-ARDynamicHeightLayoutCell activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating UICollectionView-ARDynamicHeightLayoutCell for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

UICollectionView+ARDynamicHeightLayoutCell

  • An simple category for caculating autolayout UICollectionViewCell size. Automatic manage cell's size cache, automatic invalidate, most improve efficiency.

Demo gif

Support

  • A prototype cell in storyboard

  • -registerNib:forCellReuseIdentifier:

  • -registerClass:forCellReuseIdentifier:

Usage

if your cell use autolayout , all you need just to do like this:

Fixed width

#import "UICollectionView+ARDynamicHeightLayoutCell.h"

-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
    return [collectionView ar_sizeForCellWithIdentifier:@"DynamicHeightCell" fixedWidth:300 configuration:^(id cell) {

       //configuration your cell
        FeedModel *feed = self.feeds[indexPath.row];
        [cell filleCellWithFeed:feed];

    }];
}

Fixed height

#import "UICollectionView+ARDynamicHeightLayoutCell.h"

-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
    return [collectionView ar_sizeForCellWithIdentifier:@"DynamicHeightCell" fixedHeight:400 configuration:^(id cell) {
        //configuration your cell
           FeedModel *feed = self.feeds[indexPath.row];
           [cell filleCellWithFeed:feed];
    }
}

Dynamic size

#import "UICollectionView+ARDynamicHeightLayoutCell.h"

-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
    return [collectionView ar_sizeForCellWithIdentifier:@"DynamicHeightCell" configuration:^(id cell) {
        //configuration your cell
           FeedModel *feed = self.feeds[indexPath.row];
           [cell filleCellWithFeed:feed];
    }
}

Install

pod 'UICollectionView-ARDynamicHeightLayoutCell', :git => 'https://github.com/AugustRush/UICollectionView-ARDynamicHeightLayoutCell.git'

Release Versions

  • v1.0

add cache for cell size height, improve efficiencyautomatic invalidate

  • v0.7

    add Support for StoryBoard prototype cell

  • v0.6

fixed Height caculated bug and support Dynamic size cell

  • v0.5

    support to caculate size for UICollectionView Cell

ToDo

  • pre caculate cache
UICollectionView-ARDynamicHeightLayoutCell open issues Ask a question     (View All Issues)
  • about 3 years Can you bump the latest version to pods?
  • almost 4 years Performance
UICollectionView-ARDynamicHeightLayoutCell list of languages used
Other projects in Objective-C