File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -100,10 +100,6 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
100
100
return [_tweets count ];
101
101
}
102
102
103
- - (CGFloat)tableView : (UITableView *)tableView heightForRowAtIndexPath : (NSIndexPath *)indexPath {
104
- return [TweetTableViewCell heightForCellWithTweet: [_tweets objectAtIndex: indexPath.row]];
105
- }
106
-
107
103
- (UITableViewCell *)tableView : (UITableView *)tableView cellForRowAtIndexPath : (NSIndexPath *)indexPath {
108
104
static NSString *CellIdentifier = @" Cell" ;
109
105
@@ -117,4 +113,14 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
117
113
return cell;
118
114
}
119
115
116
+ #pragma mark - UITableViewDelegate
117
+
118
+ - (CGFloat)tableView : (UITableView *)tableView heightForRowAtIndexPath : (NSIndexPath *)indexPath {
119
+ return [TweetTableViewCell heightForCellWithTweet: [_tweets objectAtIndex: indexPath.row]];
120
+ }
121
+
122
+ - (void )tableView : (UITableView *)tableView didSelectRowAtIndexPath : (NSIndexPath *)indexPath {
123
+ [tableView deselectRowAtIndexPath: indexPath animated: YES ];
124
+ }
125
+
120
126
@end
Original file line number Diff line number Diff line change 29
29
30
30
@implementation TweetTableViewCell {
31
31
@private
32
- __strong Tweet *_tweet;
33
-
34
- __strong UIImageView *_maskImageView;
32
+ __strong Tweet *_tweet;
35
33
}
36
34
37
35
@synthesize tweet = _tweet;
@@ -48,9 +46,6 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
48
46
self.detailTextLabel .numberOfLines = 0 ;
49
47
self.selectionStyle = UITableViewCellSelectionStyleGray;
50
48
51
- _maskImageView = [[UIImageView alloc ] initWithImage: [UIImage imageNamed: @" profile-image-mask" ]];
52
- [self addSubview: _maskImageView];
53
-
54
49
return self;
55
50
}
56
51
@@ -76,7 +71,6 @@ + (CGFloat)heightForCellWithTweet:(Tweet *)tweet {
76
71
- (void )layoutSubviews {
77
72
[super layoutSubviews ];
78
73
self.imageView .frame = CGRectMake (10 .0f , 10 .0f , 50 .0f , 50 .0f );
79
- _maskImageView.frame = self.imageView .frame ;
80
74
81
75
self.textLabel .frame = CGRectMake (70 .0f , 10 .0f , 240 .0f , 20 .0f );
82
76
You can’t perform that action at this time.
0 commit comments