PrizeListCollectionViewCell.m 893 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
//
//  PrizeListCollectionViewCell.m
//  Lighting
//
//  Created by 曹云霄 on 2016/11/22.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

#import "PrizeListCollectionViewCell.h"

@implementation PrizeListCollectionViewCell

13
- (void)setPrizeModel:(PrizeListModel *)prizeModel
14 15 16 17
{
    _prizeModel = prizeModel;
    [self.prizeImageView sd_setImageWithURL:[NSURL URLWithString:_prizeModel.picture] placeholderImage:REPLACEIMAGE];
    self.prizeDescribeLabel.text = _prizeModel.name;
18
    self.isSelectButton.selected = _prizeModel.isSelect;
曹云霄's avatar
曹云霄 committed
19
    self.backgroundColor = _prizeModel.isAllowSelect?[UIColor whiteColor]:[UIColor lightGrayColor];
20 21 22 23
}

#pragma mark - 选中
- (IBAction)isSelectButton:(UIButton *)sender {
曹云霄's avatar
曹云霄 committed
24 25 26 27 28
    
    if (_prizeModel.isAllowSelect) {
        sender.selected = !sender.selected;
        _prizeModel.isSelect = sender.selected;
    }
29 30 31
}

@end