Skip to content

Instantly share code, notes, and snippets.

@rscarvalho
Last active December 11, 2015 06:29
Show Gist options
  • Select an option

  • Save rscarvalho/4559721 to your computer and use it in GitHub Desktop.

Select an option

Save rscarvalho/4559721 to your computer and use it in GitHub Desktop.
@interface WPViewController ()
@property (nonatomic, strong) NSArray *posts;
@end
@implementation WPViewController
/* ... */
- (void)viewDidLoad
{
[super viewDidLoad];
self.posts = @[@"Post #1", @"Post #2", @"Post #3"];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.posts.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"post"];
cell.textLabel.text = self.posts[indexPath.row];
return cell;
}
/* ... */
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment