Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- if (indexPath.section == 0) {
- if (indexPath.row == 0) {
- ActionDetailTopTableViewCell *cell = (ActionDetailTopTableViewCell *)[tableView dequeueReusableCellWithIdentifier: kActionDetailTopTableViewCell forIndexPath:indexPath];
- [cell initWithAction:self.action andGroup:self.group];
- cell.delegate = self;
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- return cell;
- }
- else if (indexPath.row == 1 || indexPath.row == 2 || indexPath.row == 3){
- ActionDetailMenuItemTableViewCell *cell = (ActionDetailMenuItemTableViewCell *)[tableView dequeueReusableCellWithIdentifier: kActionDetailMenuItemTableViewCell forIndexPath:indexPath];
- cell.itemTitle.numberOfLines = 0;
- cell.itemTitle.delegate = self;
- if (self.indexPathRowToExpand == indexPath.row) {
- cell.openCloseMenuItemImageView.image = [UIImage imageNamed:@"Minus"];
- if (indexPath.row == 1) {
- cell.itemTitle.text = self.action.body;
- }
- else if (indexPath.row == 2) {
- cell.itemTitle.text = self.action.script;
- }
- }
- else {
- if (indexPath.row == 3) {
- cell.openCloseMenuItemImageView.image = [UIImage imageNamed:@"shareIcon"];
- }
- else {
- cell.openCloseMenuItemImageView.image = [UIImage imageNamed:@"AddGroup"];
- }
- cell.itemTitle.text = self.listOfMenuItems[indexPath.row-1];
- }
- return cell;
- }
- else {
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
- if (!cell) {
- cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
- cell.textLabel.font = [UIFont voicesBoldFontWithSize:21];
- cell.textLabel.text = @"Contact Reps";
- cell.textLabel.textAlignment = NSTextAlignmentCenter;
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- }
- return cell;
- }
- }
- else if (indexPath.section == 1) {
- if (self.listOfReps.count) {
- RepTableViewCell *cell = (RepTableViewCell *)[tableView dequeueReusableCellWithIdentifier:kRepTableViewCell forIndexPath:indexPath];
- [cell initWithRep:self.listOfReps[indexPath.row - 5]];
- return cell;
- }
- else {
- ActionDetailEmptyRepTableViewCell *cell = (ActionDetailEmptyRepTableViewCell *)[tableView dequeueReusableCellWithIdentifier: kActionDetailEmptyRepTableViewCell forIndexPath:indexPath];
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- return cell;
- }
- }
- else {
- ActionDetailFooterTableViewCell *footerCell = (ActionDetailFooterTableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"ActionDetailFooterTableViewCell" forIndexPath:indexPath];
- return footerCell;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement