1.创建控件
_timeLabel = [UILabel new];
2.把控件放到数组里NSArray *views = @[_iconView, _nameLable, _contentLabel, _moreButton, _picContainerView, _timeLabel, _operationButton, _commentView];
3.写一个UIView的拓展- (void)sd_addSubviews:(NSArray *)subviews
{
[subviews enumerateObjectsUsingBlock:^(UIView *view, NSUInteger idx, BOOL *stop) {
if ([view isKindOfClass:[UIView class]]) {
[self addSubview:view];
}
}];
}
[self.contentView sd_addSubviews:views];