Skip to content
Permalink
Browse files

Fix bugs + finish app

  • Loading branch information...
tash-had committed Dec 28, 2017
1 parent 8e54f74 commit d934b339008c27b34ded30c6d04bfc127b05589f
Showing with 4 additions and 8 deletions.
  1. BIN screenshots/demo.png
  2. +4 −8 uoft-cs-labs/TSLabsViewController.m
BIN +207 KB screenshots/demo.png
Binary file not shown.
@@ -39,11 +39,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N



if (cell.tag){
NSLog(@"%d", cell.tag);
}else{
cell.tag = indexPath.row;
}
cell.tag = indexPath.row;
// Get this cells UIView
UIView *cellQuickView = [_LabCellQuickViewsArray objectAtIndex:cell.tag];

@@ -54,13 +50,14 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

// Prepare Data
int availableInt = [[lab objectForKey:@"available"] intValue];
float percentFloat = 75;
float percentFloat = [[lab objectForKey:@"percent"] floatValue];
NSString *freeOrBusy;
if (percentFloat >= 60.0){
freeOrBusy = @"BUSY";
cellQuickView.backgroundColor = [UIColor redColor];
}else{
freeOrBusy = @"FREE";
cellQuickView.backgroundColor = [UIColor greenColor];
}

// Set Data
@@ -70,7 +67,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

if ([newLabel.text isEqual: @"DENSITY"]){
newLabel.text = freeOrBusy;
}else{
}else if (![newLabel.text isEqualToString:@"FREE"] && ![newLabel.text isEqualToString:@"BUSY"]){
newLabel.text = [NSString stringWithFormat:@"%d", availableInt];
}
}
@@ -112,7 +109,6 @@ - (void)fetchFeed{
// Create array with cellQuickView's
_LabCellQuickViewsArray = [[NSMutableArray alloc] init];
for (int i = 0;i < [_labs count];i++){
NSLog(@"adding");
UIView *cellQuickView = [[[NSBundle mainBundle] loadNibNamed:@"LabCellQuickView" owner:self options:nil] objectAtIndex:0];
[_LabCellQuickViewsArray addObject:cellQuickView];
}

0 comments on commit d934b33

Please sign in to comment.
You can’t perform that action at this time.