// // RAMenu.m // Granite Expo eSign // // Created by Ray on 02/03/2017. // Copyright © 2017 United Software Applications, Inc. All rights reserved. // #import "RAMenu.h" @implementation RAMenu /* // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. - (void)drawRect:(CGRect)rect { // Drawing code } */ - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; self.tableView.delegate = self; self.tableView.dataSource = self; self.tableView.backgroundColor = [UIColor greenColor]; [self addSubview:self.tableView]; } return self; } #pragma mark - Table view data source - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath; { return 44; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } //- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section //{ // return 44; //} - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.arr_menuItems.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *CellIdentifier = @"ADTableViewCell"; UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } NSString * item = self.arr_menuItems[indexPath.row]; cell.textLabel.text = item; return cell; } #pragma mark tableview delegate - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { } @end