Skip to content

Use autolayout to calculate and cache tableview cell height automatically just by one line code.

License

Notifications You must be signed in to change notification settings

matrixs/MAXTableView

Repository files navigation

MAXTableView

MAXTableView is an extension for UITableView and UITableViewCell. It's aimed to calculate cells' height which are layout based on AutoLayout automatically for you. It caches cell height during calculation process for optimization, and making it work is very easy.

Installation

MAXTableView is available on CocoaPods. Just add the following to you project Podfile:

pod 'MAXTableView', '~>0.0.5'

Bugs are first fixed in master and then made available via a designated release. If you tend to live on the bleeding edge, you can use Pop from master with the following Podfile entry:

pod 'MAXTableView', :git=>'https://github.com/matrixs/MAXTableView.git'

Usage

Use by including the follwing import:

#import "UITableView+MAXTableView.h"
NSMutableArray *data = [NSMutableArray new];
[yourTableView registerClass:[YourCustomCell class] bindDataSource:data delegate:self];
... //data manipulation
[yourTableView reloadData];

And then in YourCustomCell class, you need implement below method:

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    ...// Use autolayout to layout your content
}
-(void)fillData:(id)data {
	...// set data to your UIKit elements' property
}

Contributing

See the CONTRIBUTING file for how to help out.

License

MAXTableView is released under a GNU License. See LICENSE file for details.

About

Use autolayout to calculate and cache tableview cell height automatically just by one line code.

Resources

License

Stars

Watchers

Forks

Packages

No packages published