//
//  PBBeaconDetectionTableViewController.m
//  PolytechBeacon
//
//  Created by Kinan on 15/11/14.
//  Copyright (c) 2014 Kinan Arnaout. All rights reserved.
//

#import "PBBeaconDetectionTableViewController.h"

@interface PBBeaconDetectionTableViewController ()

@property NSArray *beaconList;

@end

@implementation PBBeaconDetectionTableViewController

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.beaconList = @[@"beacon 1", @"beacon 2", @"beacon 3", @"beacon 4"];
}

- (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.beaconList.count;
}


- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    return @"";
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BeaconCell" forIndexPath:indexPath];
    
    // Configure the cell...
    [cell.textLabel setText:[self.beaconList objectAtIndex:indexPath.row]];
    
    [cell.detailTextLabel setText:@"iBeacon description"];
    
    return cell;
}



@end
