| // |
| // RACTestTableViewController.m |
| // ReactiveCocoa |
| // |
| // Created by Syo Ikeda on 12/30/13. |
| // Copyright (c) 2013 GitHub, Inc. All rights reserved. |
| // |
| |
| #import "RACTestTableViewController.h" |
| |
| @implementation RACTestTableViewController |
| |
| - (instancetype)initWithStyle:(UITableViewStyle)style { |
| self = [super initWithStyle:style]; |
| if (self == nil) return nil; |
| |
| [self.tableView registerClass:UITableViewHeaderFooterView.class forHeaderFooterViewReuseIdentifier:NSStringFromClass(self.class)]; |
| |
| return self; |
| } |
| |
| - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { |
| UITableViewHeaderFooterView *headerView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:NSStringFromClass(self.class)]; |
| return headerView; |
| } |
| |
| - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
| return [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(self.class)] ?: [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass(self.class)]; |
| } |
| |
| - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { |
| return 2; |
| } |
| |
| - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { |
| return 20; |
| } |
| |
| @end |