Skip to content

Commit 24f2300

Browse files
committed
A few minor fixes to new iOS example
1 parent ebfbbd1 commit 24f2300

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

iOS Example/Classes/Controllers/PublicTimelineViewController.m

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
100100
return [_tweets count];
101101
}
102102

103-
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
104-
return [TweetTableViewCell heightForCellWithTweet:[_tweets objectAtIndex:indexPath.row]];
105-
}
106-
107103
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
108104
static NSString *CellIdentifier = @"Cell";
109105

@@ -117,4 +113,14 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
117113
return cell;
118114
}
119115

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+
120126
@end

iOS Example/Classes/Views/TweetTableViewCell.m

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929

3030
@implementation TweetTableViewCell {
3131
@private
32-
__strong Tweet *_tweet;
33-
34-
__strong UIImageView *_maskImageView;
32+
__strong Tweet *_tweet;
3533
}
3634

3735
@synthesize tweet = _tweet;
@@ -48,9 +46,6 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
4846
self.detailTextLabel.numberOfLines = 0;
4947
self.selectionStyle = UITableViewCellSelectionStyleGray;
5048

51-
_maskImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"profile-image-mask"]];
52-
[self addSubview:_maskImageView];
53-
5449
return self;
5550
}
5651

@@ -76,7 +71,6 @@ + (CGFloat)heightForCellWithTweet:(Tweet *)tweet {
7671
- (void)layoutSubviews {
7772
[super layoutSubviews];
7873
self.imageView.frame = CGRectMake(10.0f, 10.0f, 50.0f, 50.0f);
79-
_maskImageView.frame = self.imageView.frame;
8074

8175
self.textLabel.frame = CGRectMake(70.0f, 10.0f, 240.0f, 20.0f);
8276

0 commit comments

Comments
 (0)