Skip to content

Template auto layout cell for automatically UITableViewCell height calculating

License

Notifications You must be signed in to change notification settings

ltebean/UITableView-FDTemplateLayoutCell

 
 

Repository files navigation

UITableView-FDTemplateLayoutCell


Overview

Template auto layout cell for automatically UITableViewCell height calculating.

Demo Overview

Usage

If you have a self-satisfied cell, then all you have to do is:

#import "UITableView+FDTemplateLayoutCell.h"

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return [tableView fd_heightForCellWithIdentifier:@"reuse identifer" configuration:^(id cell) {
        // Configure this cell with data, same as what you've done in "-tableView:cellForRowAtIndexPath:"
        // Like:
        //    cell.entity = self.feedEntities[indexPath.row];
    }];
}

About self-satisfied cell

a fully self-satisfied cell is constrainted by auto layout and each edge("top", "left", "bottom", "right") has at least one layout constraint against it.

A bad one :( - missing right and bottom non-self-satisfied

A good one :)
self-satisfied

Installation

pod search UITableView+FDTemplateLayoutCell 

License

MIT

About

Template auto layout cell for automatically UITableViewCell height calculating

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 85.1%
  • Ruby 14.9%