Guest User

Untitled

a guest
Jan 26th, 2014
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. //
  2. // SidebarViewController.m
  3. // SidebarDemo
  4. //
  5. // Created by Simon on 29/6/13.
  6. // Copyright (c) 2013 Appcoda. All rights reserved.
  7. //
  8.  
  9. #import "SidebarViewController.h"
  10. #import "PhotoViewController.h"
  11. #import "SWRevealViewController.h"
  12. #import "PhotoViewController.h"
  13.  
  14.  
  15.  
  16. @interface SidebarViewController ()
  17.  
  18. @property (nonatomic, strong) NSArray *menuItems;
  19. @end
  20.  
  21. @implementation SidebarViewController
  22.  
  23. - (id)initWithStyle:(UITableViewStyle)style
  24. {
  25. self = [super initWithStyle:style];
  26. if (self) {
  27. // Custom initialization
  28. }
  29. return self;
  30. }
  31.  
  32. - (void)viewDidLoad
  33. {
  34. self.view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:1.0f];
  35. self.tableView.backgroundColor = [UIColor colorWithWhite:0.2f alpha:1.0f];
  36. self.tableView.separatorColor = [UIColor colorWithWhite:0.15f alpha:0.2f];
  37.  
  38. _menuItems = @[@"title", @"news", @"comments", @"map", @"calendar", @"wishlist", @"bookmark", @"tag"];
  39.  
  40. [super viewDidLoad];
  41.  
  42. }
  43.  
  44. - (void)didReceiveMemoryWarning
  45. {
  46. [super didReceiveMemoryWarning];
  47. // Dispose of any resources that can be recreated.
  48. }
  49.  
  50.  
  51.  
  52. #pragma mark - Table view data source
  53.  
  54. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  55. {
  56. // Return the number of sections.
  57. return 1;
  58. }
  59.  
  60. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  61. {
  62. // Return the number of rows in the section.
  63. return [self.menuItems count];
  64. }
  65. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  66. {
  67. NSString *CellIdentifier = [self.menuItems objectAtIndex:indexPath.row];
  68. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
  69.  
  70. return cell;
  71. }
  72.  
  73.  
  74. @end
Advertisement
Add Comment
Please, Sign In to add comment