Created
November 3, 2012 12:16
-
-
Save gonzalezreal/4007223 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import "TGRTweetCell.h" | |
| . | |
| . | |
| . | |
| - (void)viewDidLoad | |
| { | |
| [super viewDidLoad]; | |
| self.title = NSLocalizedString(@"Timeline", @""); | |
| // Registramos nuestra celda en la tabla | |
| [self.tableView registerClass:[TGRTweetCell class] forCellReuseIdentifier:kTweetCellIdentifier]; | |
| self.refreshControl = [[UIRefreshControl alloc] init]; | |
| [self.refreshControl addTarget:self | |
| action:@selector(loadNewTweets) | |
| forControlEvents:UIControlEventValueChanged]; | |
| } | |
| . | |
| . | |
| . | |
| - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
| { | |
| // Obtenemos una celda | |
| TGRTweetCell *cell = [tableView dequeueReusableCellWithIdentifier:kTweetCellIdentifier]; | |
| // Obtenemos el tweet correspondiente | |
| TGRTweet *tweet = [self.fetchedResultsController objectAtIndexPath:indexPath]; | |
| // Configuramos la celda con el tweet | |
| [cell configureWithTweet:tweet]; | |
| return cell; | |
| } | |
| - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | |
| { | |
| // Obtenemos el tweet | |
| TGRTweet *tweet = [self.fetchedResultsController objectAtIndexPath:indexPath]; | |
| // Obtenemos la altura necesaria para el tweet | |
| return [TGRTweetCell heightForTweet:tweet]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment