refactor: Use updated API to retrieve seismics
This commit is contained in:
@@ -28,24 +28,24 @@
|
||||
[super setupView];
|
||||
|
||||
NSString *temp = NSLocalizedString(@"Temperatura: ", @"");
|
||||
NSString *valueTemp = [NSString stringWithFormat:@"%1.f °C", [self.sisma.te floatValue]-273];
|
||||
NSString *valueTemp = [NSString stringWithFormat:@"%1.f °C", [self.sisma.weatherTemperature floatValue]-273];
|
||||
NSString *tempDesc = [NSString stringWithFormat:@"%@%@", temp, valueTemp];
|
||||
|
||||
|
||||
NSString *pres = NSLocalizedString(@"Pressione:", @"");
|
||||
NSString *valuePre = [NSString stringWithFormat:@"%@mb", self.sisma.pr];
|
||||
NSString *valuePre = [NSString stringWithFormat:@"%@mb", self.sisma.weatherPressure];
|
||||
NSString *presDesc = [NSString stringWithFormat:@"%@%@",pres, valuePre];
|
||||
|
||||
NSString *vent = NSLocalizedString(@"Velocità vento: ", @"");
|
||||
NSString *valueVento = [NSString stringWithFormat:@"%@m/s", self.sisma.ws];
|
||||
NSString *valueVento = [NSString stringWithFormat:@"%@m/s", self.sisma.weatherWindSpeed];
|
||||
NSString *ventoDesc = [NSString stringWithFormat:@"%@%@", vent, valueVento];
|
||||
|
||||
NSString *umi = NSLocalizedString(@"Umidità : ", @"");
|
||||
NSString *umiValue = [NSString stringWithFormat:@"%@%%", self.sisma.hu];
|
||||
NSString *umiValue = [NSString stringWithFormat:@"%@%%", self.sisma.weatherHumidity];
|
||||
NSString *umiditaDesc = [NSString stringWithFormat:@"%@%@", umi, umiValue];
|
||||
|
||||
NSString *nuv = NSLocalizedString(@"Copertura nuvolosa : ", @"");
|
||||
NSString *nuvValue = [NSString stringWithFormat:@"%@%%", self.sisma.cl];
|
||||
NSString *nuvValue = [NSString stringWithFormat:@"%@%%", self.sisma.weatherCloud];
|
||||
NSString *nuvolDesc = [NSString stringWithFormat:@"%@%@",nuv, nuvValue];
|
||||
|
||||
UILabel *titolo = (UILabel *)[self viewWithTag:20];
|
||||
@@ -67,7 +67,7 @@
|
||||
nuvolosita.attributedText = [self getAttributeString:nuvolDesc withRange:NSMakeRange(nuv.length, nuvValue.length)];
|
||||
|
||||
UIImageView *icona = (UIImageView *)[self viewWithTag:26];
|
||||
NSString *imagName = [NSString stringWithFormat:@"weather_%@.png", self.sisma.ic];
|
||||
NSString *imagName = [NSString stringWithFormat:@"weather_%@.png", self.sisma.weatherIcon];
|
||||
icona.image = [UIImage imageNamed:imagName];
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -41,13 +41,13 @@
|
||||
UILabel *data = (UILabel *)[self viewWithTag:6];
|
||||
|
||||
int tempo = 0;
|
||||
if ([self.sisma.differenza intValue] > 60) {
|
||||
if ([self.sisma.difference intValue] > 60) {
|
||||
|
||||
tempo = [self.sisma.differenza intValue]/60;
|
||||
data.text = [NSString stringWithFormat:@"%@ %@",NSLocalizedString(@"Data(Ora tua):", @"") , [NSString stringWithFormat:@"%@ - %d %@", self.sisma.data, tempo, NSLocalizedString(@"ore fa", @"")]];
|
||||
tempo = [self.sisma.difference intValue]/60;
|
||||
data.text = [NSString stringWithFormat:@"%@ %@",NSLocalizedString(@"Data(Ora tua):", @"") , [NSString stringWithFormat:@"%@ - %d %@", self.sisma.date, tempo, NSLocalizedString(@"ore fa", @"")]];
|
||||
}else{
|
||||
|
||||
data.text = [NSString stringWithFormat:@"%@ %@",NSLocalizedString(@"Data(Ora tua):", @"") , [NSString stringWithFormat:@"%@ - %@ %@", self.sisma.data, self.sisma.differenza, NSLocalizedString(@"minuti fa", @"")]];
|
||||
data.text = [NSString stringWithFormat:@"%@ %@",NSLocalizedString(@"Data(Ora tua):", @"") , [NSString stringWithFormat:@"%@ - %@ %@", self.sisma.date, self.sisma.difference, NSLocalizedString(@"minuti fa", @"")]];
|
||||
}
|
||||
|
||||
// UILabel *dataValue = (UILabel *)[self viewWithTag:8];
|
||||
|
||||
Reference in New Issue
Block a user