Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // SidebarViewController.m
- // SidebarDemo
- //
- // Created by Simon on 29/6/13.
- // Copyright (c) 2013 Appcoda. All rights reserved.
- //
- #import "SidebarViewController.h"
- #import "PhotoViewController.h"
- #import "SWRevealViewController.h"
- #import "PhotoViewController.h"
- @interface SidebarViewController ()
- @property (nonatomic, strong) NSArray *menuItems;
- @end
- @implementation SidebarViewController
- - (id)initWithStyle:(UITableViewStyle)style
- {
- self = [super initWithStyle:style];
- if (self) {
- // Custom initialization
- }
- return self;
- }
- - (void)viewDidLoad
- {
- self.view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:1.0f];
- self.tableView.backgroundColor = [UIColor colorWithWhite:0.2f alpha:1.0f];
- self.tableView.separatorColor = [UIColor colorWithWhite:0.15f alpha:0.2f];
- _menuItems = @[@"title", @"news", @"comments", @"map", @"calendar", @"wishlist", @"bookmark", @"tag"];
- [super viewDidLoad];
- }
- - (void)didReceiveMemoryWarning
- {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- #pragma mark - Table view data source
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- {
- // Return the number of sections.
- return 1;
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
- // Return the number of rows in the section.
- return [self.menuItems count];
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- NSString *CellIdentifier = [self.menuItems objectAtIndex:indexPath.row];
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
- return cell;
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment