Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (CGFloat)heightForTweetCellWithString:(NSString *)text {
- CGFloat height = Buffer + [text sizeWithFont:Font constrainedToSize:Size lineBreakMode:LineBreakMode].height;
- return MAX(height, MinHeight);
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
- NSString *text = // get tweet text for this indexpath
- return [self heightForTweetCellWithString:text];
- }
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- static NSString *CellIdentifier = @"TweetCell";
- TweetCell *cell = (TweetCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil) {
- cell = [self createNewTweetCellFromNib];
- }
- cell.tweet.text = // tweet text
- // set other labels, etc
- return cell;
- }
Add Comment
Please, Sign In to add comment