-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathExampleCollectionViewCell.m
More file actions
39 lines (31 loc) · 1.02 KB
/
ExampleCollectionViewCell.m
File metadata and controls
39 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// Created by Tom Quist on 06.12.14.
// Copyright (c) 2014 Tom Quist. All rights reserved.
//
#import "ExampleCollectionViewCell.h"
#import "CollectionViewItem.h"
#import "IDLLayoutBridge.h"
@implementation ExampleCollectionViewCell {
UILabel *_titleLabel;
UILabel *_subtitleLabel;
UILabel *_descriptionLabel;
}
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithLayoutResource:@"collectionViewCell.xml"];
if (self) {
_titleLabel = (UILabel *)[self.layoutBridge findViewById:@"title"];
_subtitleLabel = (UILabel *)[self.layoutBridge findViewById:@"subtitle"];
_descriptionLabel = (UILabel *)[self.layoutBridge findViewById:@"description"];
}
return self;
}
- (void)setItem:(CollectionViewItem *)item {
_titleLabel.text = item.title;
_subtitleLabel.text = item.subtitle;
_descriptionLabel.text = item.itemDescription;
}
/*- (CGSize)sizeThatFits:(CGSize)size {
size.height = [self requiredHeightForWidth:size.width];
return size;
} */
@end