#import <UIKit/UIKit.h>
#import "WSCollectionViewCell.h"
@interface WSCollectionView : UICollectionView
@property (nonatomic, strong) NSIndexPath *indexPath;
@end
static NSString *CollectionViewCellIdentifier = @"CollectionViewCellIdentifier";
@interface WSTableViewCell : UITableViewCell
@property (nonatomic,strong)WSCollectionView *collectionView;
@property (nonatomic,strong)UIImageView *itemImageView;
@property (nonatomic,strong)UILabel *contentLabel;
- (void)setCollectionViewDataSourceDelegate:(id<UICollectionViewDataSource, UICollectionViewDelegate>)dataSourceDelegate indexPath:(NSIndexPath *)indexPath;
- (void)configureCellWithInfo:(NSDictionary *)data;
@end
#import "WSTableViewCell.h"
@implementation WSCollectionView
@end
@implementation WSTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self initialize];
}
return self;
}
- (void)initialize
{
self.selectionStyle = UITableViewCellSelectionStyleNone;
CGFloat tempImageWith = [UIScreen mainScreen].bounds.size.width / 640;
CGFloat tempHeight = 480 * tempImageWith;
self.itemImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, tempHeight)];
self.itemImageView.contentMode = UIViewContentModeScaleAspectFill;
self.itemImageView.clipsToBounds = YES;
[self.contentView addSubview:_itemImageView];
self.contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, _itemImageView.frame.size.height + 10, [UIScreen mainScreen].bounds.size.width - 20, 40)];
self.conten