-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpeakerViewController.m
60 lines (44 loc) · 1.5 KB
/
SpeakerViewController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// SpeakerViewController.m
// Piel
//
// Created by Raul on 30/03/2015.
// Copyright (c) 2015 PIEL. All rights reserved.
//
#import "SpeakerViewController.h"
#import "SpeakerTableViewCell.h"
#import "PLSpeaker.h"
@interface SpeakerViewController ()
@end
@implementation SpeakerViewController
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
//self.navigationItem.title = (self.viewTitle) ? self.viewTitle:@"";
}
- (void)viewDidLoad
{
[super viewDidLoad];
// This will remove extra separators from tableview
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [self.speakersArray count];
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
SpeakerTableViewCell *cell = (SpeakerTableViewCell*)[tableView dequeueReusableCellWithIdentifier:@"speakerCell"];
PLSpeaker *speaker = (PLSpeaker*)[self.speakersArray objectAtIndex:indexPath.row];
cell.name.text = speaker.speaker;
cell.speakerTitle.text = speaker.title;
cell.company.text = speaker.company;
if (speaker.imageName) {
NSString *imageName = [NSString stringWithFormat:@"%@.png",speaker.imageName];
cell.speakerImage.image = [UIImage imageNamed:imageName];
}
return cell;
}
@end