//
//  GMTableViewCell+Layout.m
//  Gengmei
//
//  Created by wangyang on 2017/7/19.
//  Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//

#import "GMTableViewCell+Layout.h"
#import <Masonry/Masonry.h>
#define IMAGE_COUNT         3
#define IMAGE_SPACE         10

@implementation GMTableViewCell (Layout)
+ (CGSize)cellImageSize {
    CGFloat imageWidth = ceil(([self contentWidth] - (IMAGE_COUNT - 1 ) * IMAGE_SPACE) / IMAGE_COUNT);
    CGFloat imageHeight = imageWidth;
    return CGSizeMake(imageWidth, imageHeight);
}
+ (CGFloat)contentWidth {
    return UIScreen.mainScreen.bounds.size.width - EDGE * 2;
}

- (void)useEdgeBottomLine {
    [self.bottomLine mas_updateConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.right.mas_equalTo(-20);
    }];
    [self.contentView bringSubviewToFront:self.bottomLine];
}
@end
