15 - (id)initWithFrame:(CGRect)frame {
17 self = [
super initWithFrame:frame];
23 NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"Y4NutritionItemView" owner:self options:nil];
25 if ([arrayOfViews count] < 1) {
29 if (![[arrayOfViews objectAtIndex:0] isKindOfClass:[UICollectionViewCell
class]]) {
41 CGRect imageFrame = CGRectMake(0.0, 0.0, 180.0, 184.0);
43 _imageView = [[UIImageView alloc] initWithFrame:imageFrame];
45 [
self.contentView addSubview:_imageView];
54 CGRect textFrame = CGRectMake(0.0, 124.0, 120.0, 40.0);
56 _textLabel = [[UILabel alloc] initWithFrame:textFrame];
57 _textLabel.backgroundColor = [UIColor colorWithRed:0.3f green:1.0f blue:0.7f alpha:1.0f];
58 _textLabel.font = [UIFont fontWithName:@"Verdana" size:10.0f];
61 [
self.contentView addSubview:_textLabel];
81 [
super prepareForReuse];
83 [
self.imageView removeFromSuperview];
84 [
self.textLabel removeFromSuperview];
IBOutlet UILabel * textLabel