Skip to content

Instantly share code, notes, and snippets.

@sgoodwin
Created November 19, 2012 20:06
Show Gist options
  • Save sgoodwin/4113536 to your computer and use it in GitHub Desktop.
Save sgoodwin/4113536 to your computer and use it in GitHub Desktop.
Switch free controller.
@implementation RWSViewController
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
RWSStaticSection *section1 = [[RWSStaticSection alloc] init];
RWSStaticSection *section2 = [[RWSStaticSection alloc] init];
_sections = @[section1, section2];
}
return self;
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return [self.sections count];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
RWSSection section = self.section[section];
return [section numberOfObjects];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
RWSSection section = self.section[indexPath.section];
return [section tableView:tableView cellForRow:indexPAth.row];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment