void updateWithInfo NSDictionary info self rout info objectForKey rout

 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
- (void)updateWithInfo:(NSDictionary *)info
{
self.rout = [info objectForKey:@"rout"];
self.services = [info objectForKey:@"optional"];
self.dateLabel.text = [(NSDate *)[info objectForKey:@"date"] formattedStringWithFormat:@"dd MMMM, HH:mm"];
self.peopleLabel.text = [NSString stringWithFormat:@"Пассажиры: %ld", [[info objectForKey:@"peoples"] integerValue]];
self.cargoCategoryLabel.text = GRCargoCategoryTypeString([[info objectForKey:@"cargo"] integerValue]);
self.commentLabel.text = [info objectForKey:@"comment"];
self.photosWidthConstraint.constant = ((NSArray *)[info objectForKey:@"photos"]).count == 0 ? 0 : 80;
switch ([[info objectForKey:@"car"] integerValue]) {
case 0:
self.carImageView.image = [GruzerStyle imageOfCar_1];
self.carLabel.text = @"до 1,5 тонн";
break;
case 1:
self.carImageView.image = [GruzerStyle imageOfCar_2];
self.carLabel.text = @"до 2 тонн";
break;
case 2:
self.carImageView.image = [GruzerStyle imageOfCar_3];
self.carLabel.text = @"до 3 тонн";
break;
default:
break;
}
[self.tableView reloadData];
}