4d8bbdc7ef
Add to Git the current app version (the same available in the OriginalZip folder)
538 lines
22 KiB
Objective-C
538 lines
22 KiB
Objective-C
//
|
|
// AletaSismiTableViewController.m
|
|
// Earthquake Network
|
|
//
|
|
// Created by Luca Beretta on 14/01/2019.
|
|
// Copyright © 2019 Luca Beretta. All rights reserved.
|
|
//
|
|
|
|
#import "AllertaSismiTableViewController.h"
|
|
#import "EQNAllertaSismica.h"
|
|
#import "PickerViewController.h"
|
|
#import "EQNUtility.h"
|
|
#import "TBDInputViewControllerData.h"
|
|
|
|
@interface AllertaSismiTableViewController () <PickerViewDelegate, UITextFieldDelegate, InputViewControllerDataDelegate>
|
|
|
|
@property (nonatomic, strong) NSArray *lista;
|
|
@property (nonatomic, assign) BOOL isAbilitato;
|
|
@property (nonatomic, assign) BOOL isSimiSenzaIntensita;
|
|
@property (nonatomic, assign) BOOL isintervalloAllarme;
|
|
|
|
@property (nonatomic, strong) UITextField *textSismiNotificare;
|
|
@property (nonatomic, strong) NSString *stringSismiNotificare;
|
|
@property (nonatomic, strong) UITextField *textraggioSismiLievi;
|
|
@property (nonatomic, strong) NSString *stringraggioSismiLievi;
|
|
@property (nonatomic, strong) UITextField *textraggioSismiForti;
|
|
@property (nonatomic, strong) NSString *stringraggioSismiForti;
|
|
@property (nonatomic, strong) UITextField *textTono;
|
|
@property (nonatomic, strong) NSString *stringaTono;
|
|
@property (nonatomic, strong) NSString *oraInizio;
|
|
@property (nonatomic, strong) NSString *oraFine;
|
|
@property (nonatomic, strong) UITextField *textFildInizio;
|
|
@property (nonatomic, strong) UITextField *textFildfine;
|
|
@property (nonatomic, strong) PickerViewController *pikerViewIntensita;
|
|
@property (nonatomic, strong) PickerViewController *pikerViewDistanza;
|
|
@property (nonatomic, strong) PickerViewController *pikerViewToni;
|
|
@property (nonatomic, strong) PickerViewController *pikerViewforti;
|
|
@property (nonatomic, strong) TBDInputViewControllerData *pikerViewController;
|
|
@property (nonatomic, strong) UITextField *textFild;
|
|
@property (nonatomic, strong) NSDateFormatter *dateFormatter;
|
|
@property (nonatomic, strong) UIColor *textColor;
|
|
|
|
@end
|
|
|
|
@implementation AllertaSismiTableViewController
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
|
|
self.lista = @[NSLocalizedString(@"Abilitato", @"voce menu"),
|
|
NSLocalizedString(@"Sismi da notificare", @"voce menu"),
|
|
NSLocalizedString(@"Sismi senza intensità", @"voce menu"),
|
|
NSLocalizedString(@"Raggio sismi lievi", @"voce menu"),
|
|
NSLocalizedString(@"Raggio sismi forti o intensità non disponibile", @"voce menu"),
|
|
/*NSLocalizedString(@"Tono di allarme", @"voce menu"),
|
|
NSLocalizedString(@"Imposta volume", @"voce menu"),
|
|
NSLocalizedString(@"Testa allarme", @"voce menu"),*/
|
|
NSLocalizedString(@"Intervallo allarme", @"voce menu"),
|
|
NSLocalizedString(@"Ora di inizio", @"voce menu"),
|
|
NSLocalizedString(@"Ora di fine", @"voce menu"),];
|
|
|
|
self.pikerViewIntensita = [[PickerViewController alloc] initWithNibName:@"PickerViewController" bundle:nil dati:@[NSLocalizedString(@"Magnitudo >= 2.0", @"voce menu"), NSLocalizedString(@"Magnitudo >= 3.0", @"voce menu"), NSLocalizedString(@"Magnitudo >= 3.5", @"voce menu"), NSLocalizedString(@"Magnitudo >= 4.5", @"voce menu"), NSLocalizedString(@"Magnitudo >= 5.5", @"voce menu"), NSLocalizedString(@"Magnitudo >= 6.0", @"voce menu"), NSLocalizedString(@"Magnitudo >= 6.5", @"voce menu"), NSLocalizedString(@"Magnitudo >= 7.5", @"voce menu"), NSLocalizedString(@"Magnitudo >= 7.5", @"voce menu")]];
|
|
self.pikerViewIntensita.delegate = self;
|
|
|
|
self.pikerViewforti = [[PickerViewController alloc] initWithNibName:@"PickerViewController" bundle:nil dati:@[NSLocalizedString(@"Qualsiasi intensità", @"voce menu"), NSLocalizedString(@"Solo sismi forti", @"voce menu")]];
|
|
self.pikerViewforti.delegate = self;
|
|
|
|
self.pikerViewToni = [[PickerViewController alloc] initWithNibName:@"PickerViewController" bundle:nil dati:@[@"alert_star_trek.wav",@"alerta_japanese.m4r",@"alerta_mexico.m4r"]];
|
|
self.pikerViewToni.delegate = self;
|
|
|
|
self.pikerViewDistanza = [[PickerViewController alloc] initWithNibName:@"PickerViewController" bundle:nil dati:[EQNUtility arrayRaggioSismi]];
|
|
self.pikerViewDistanza.delegate = self;
|
|
|
|
self.pikerViewController = [[TBDInputViewControllerData alloc] initWithNibName:@"TBDInputViewControllerData" bundle:nil];
|
|
self.pikerViewController.delegate = self;
|
|
|
|
self.dateFormatter = [[NSDateFormatter alloc] init];
|
|
[self.dateFormatter setDateFormat:@"HH:mm"];
|
|
self.textColor = [UIColor colorWithRed:0 green:0.5647 blue:0.317 alpha:1];
|
|
|
|
|
|
if (![EQNAllertaSismica center].sismiDaNotificare || [[EQNAllertaSismica center].sismiDaNotificare isEqualToString:@"0"])
|
|
[EQNAllertaSismica center].sismiDaNotificare = @"0";
|
|
else{
|
|
[EQNAllertaSismica center].sismiDaNotificare = @"1";
|
|
}
|
|
if (![EQNAllertaSismica center].raggioSismiLievi|| [[EQNAllertaSismica center].sismiDaNotificare isEqualToString:@"100000"])
|
|
[EQNAllertaSismica center].raggioSismiLievi = @"100000";
|
|
if (![EQNAllertaSismica center].raggioSismiForti|| [[EQNAllertaSismica center].sismiDaNotificare isEqualToString:@"100000"])
|
|
[EQNAllertaSismica center].raggioSismiForti = @"100000";
|
|
|
|
|
|
[self setupView];
|
|
}
|
|
|
|
-(void)setupView{
|
|
|
|
self.isAbilitato = [EQNAllertaSismica center].isAbilitato;
|
|
self.isSimiSenzaIntensita = [EQNAllertaSismica center].isSimiSenzaIntensita;
|
|
self.isintervalloAllarme = [EQNAllertaSismica center].isintervalloAllarme;
|
|
|
|
if (![EQNAllertaSismica center].sismiDaNotificare || [[EQNAllertaSismica center].sismiDaNotificare isEqualToString:@"0"])
|
|
self.stringSismiNotificare = NSLocalizedString(@"Qualsiasi intensità", @"voce menu");
|
|
else
|
|
self.stringSismiNotificare = NSLocalizedString(@"Solo sismi forti", @"voce menu");
|
|
|
|
if ([[EQNAllertaSismica center].raggioSismiLievi isEqualToString:@"100000"])
|
|
self.stringraggioSismiLievi = NSLocalizedString(@"Qualsiasi distanza", @"voce elenco raggio sismi");
|
|
else
|
|
self.stringraggioSismiLievi = [EQNAllertaSismica center].raggioSismiLievi;
|
|
|
|
if ([[EQNAllertaSismica center].raggioSismiForti isEqualToString:@"100000"])
|
|
self.stringraggioSismiForti = NSLocalizedString(@"Qualsiasi distanza", @"voce elenco raggio sismi");
|
|
else
|
|
self.stringraggioSismiForti = [EQNAllertaSismica center].raggioSismiForti;
|
|
|
|
self.stringaTono = [EQNAllertaSismica center].tonoAllarme;
|
|
|
|
if ([EQNAllertaSismica center].oraioInizio)
|
|
self.oraInizio = [self.dateFormatter stringFromDate:[EQNAllertaSismica center].oraioInizio];
|
|
else
|
|
self.oraInizio = @"8:00";
|
|
if ([EQNAllertaSismica center].orarioFine)
|
|
self.oraFine = [self.dateFormatter stringFromDate:[EQNAllertaSismica center].orarioFine];
|
|
else
|
|
self.oraFine = @"22:00";
|
|
|
|
[self.tableView reloadData];
|
|
}
|
|
|
|
|
|
#pragma mark - Table view data source
|
|
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
|
return 1;
|
|
}
|
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
return self.lista.count;
|
|
}
|
|
|
|
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
|
return 90;
|
|
|
|
}
|
|
|
|
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
|
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellSection"];
|
|
UILabel *titolo = (UILabel *)[cell viewWithTag:1];
|
|
titolo.text = NSLocalizedString(@"Alerta sismica", @"titolo impostazioni notifiche");
|
|
|
|
return cell;
|
|
|
|
}
|
|
|
|
|
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
|
switch (indexPath.row) {
|
|
case 0:{
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellaSelezioneAbilita"];
|
|
UILabel *titolo = (UILabel *)[cell viewWithTag:1];
|
|
titolo.text = self.lista[indexPath.row];
|
|
UILabel *stato = (UILabel *)[cell viewWithTag:2];
|
|
stato.text = NSLocalizedString(@"Suona un allarme quando un sisma è rilevato dalla rete di smartphones ", @"voce menu");
|
|
if (self.isAbilitato){
|
|
cell.accessoryType = UITableViewCellAccessoryCheckmark;
|
|
titolo.textColor = [UIColor blackColor];
|
|
stato.textColor = [UIColor blackColor];
|
|
}
|
|
else{
|
|
cell.accessoryType = UITableViewCellAccessoryNone;
|
|
titolo.textColor = [UIColor grayColor];
|
|
stato.textColor = [UIColor grayColor];
|
|
}
|
|
return cell;
|
|
}
|
|
break;
|
|
case 1:{
|
|
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"vociDettagli"];
|
|
UILabel *titolo = (UILabel *)[cell viewWithTag:1];
|
|
titolo.text = self.lista[indexPath.row];
|
|
self.textSismiNotificare = (UITextField *)[cell viewWithTag:2];
|
|
self.textSismiNotificare.delegate = self;
|
|
self.textSismiNotificare.inputView = self.pikerViewforti.view;
|
|
self.textSismiNotificare.text = self.stringSismiNotificare;
|
|
if (self.isAbilitato){
|
|
self.textSismiNotificare.textColor = self.textColor;
|
|
titolo.textColor = [UIColor blackColor];
|
|
|
|
}
|
|
else{
|
|
self.textSismiNotificare.textColor = [UIColor grayColor];
|
|
titolo.textColor = [UIColor grayColor];
|
|
|
|
}
|
|
|
|
self.textSismiNotificare.enabled = self.isAbilitato;
|
|
|
|
return cell;
|
|
|
|
}
|
|
break;
|
|
case 2:{
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellaSelezioneAbilita"];
|
|
UILabel *titolo = (UILabel *)[cell viewWithTag:1];
|
|
titolo.text = self.lista[indexPath.row];
|
|
UILabel *stato = (UILabel *)[cell viewWithTag:2];
|
|
stato.text = NSLocalizedString(@"Attiva l'allerta anche su i sismi per i quali non è possibile stimare l'intensità", @"voce menu");
|
|
if (self.isSimiSenzaIntensita && self.isAbilitato){
|
|
cell.accessoryType = UITableViewCellAccessoryCheckmark;
|
|
titolo.textColor = [UIColor blackColor];
|
|
stato.textColor = [UIColor blackColor];
|
|
}
|
|
else{
|
|
cell.accessoryType = UITableViewCellAccessoryNone;
|
|
titolo.textColor = [UIColor grayColor];
|
|
stato.textColor = [UIColor grayColor];
|
|
}
|
|
return cell;
|
|
}
|
|
break;
|
|
case 3:{
|
|
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"vociDettagli"];
|
|
UILabel *titolo = (UILabel *)[cell viewWithTag:1];
|
|
titolo.text = self.lista[indexPath.row];
|
|
self.textraggioSismiLievi = (UITextField *)[cell viewWithTag:2];
|
|
self.textraggioSismiLievi.delegate = self;
|
|
self.textraggioSismiLievi.inputView = self.pikerViewDistanza.view;
|
|
self.textraggioSismiLievi.text = self.stringraggioSismiLievi;
|
|
if (self.isAbilitato){
|
|
self.textraggioSismiLievi.textColor = self.textColor;
|
|
titolo.textColor = [UIColor blackColor];
|
|
|
|
}
|
|
else{
|
|
self.textraggioSismiLievi.textColor = [UIColor grayColor];
|
|
titolo.textColor = [UIColor grayColor];
|
|
|
|
}
|
|
self.textraggioSismiLievi.enabled = self.isAbilitato;
|
|
|
|
|
|
return cell;
|
|
|
|
}
|
|
break;
|
|
case 4:{
|
|
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"vociDettagli"];
|
|
UILabel *titolo = (UILabel *)[cell viewWithTag:1];
|
|
titolo.text = self.lista[indexPath.row];
|
|
self.textraggioSismiForti = (UITextField *)[cell viewWithTag:2];
|
|
self.textraggioSismiForti.delegate = self;
|
|
self.textraggioSismiForti.inputView = self.pikerViewDistanza.view;
|
|
self.textraggioSismiForti.text = self.stringraggioSismiForti;
|
|
if (self.isAbilitato){
|
|
self.textraggioSismiForti.textColor = self.textColor;
|
|
titolo.textColor = [UIColor blackColor];
|
|
|
|
}
|
|
else{
|
|
self.textraggioSismiForti.textColor = [UIColor grayColor];
|
|
titolo.textColor = [UIColor grayColor];
|
|
|
|
}
|
|
|
|
self.textraggioSismiForti.enabled = self.isAbilitato;
|
|
|
|
return cell;
|
|
|
|
}
|
|
break;
|
|
/* case 5:{
|
|
|
|
// UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"vociDettagli" forIndexPath:indexPath];
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"vociDettagli"];
|
|
UILabel *titolo = (UILabel *)[cell viewWithTag:1];
|
|
titolo.text = self.lista[indexPath.row];
|
|
self.textTono = (UITextField *)[cell viewWithTag:2];
|
|
self.textTono.delegate = self;
|
|
self.textTono.inputView = self.pikerViewToni.view;
|
|
self.textTono.text = self.stringaTono;
|
|
if (self.isAbilitato){
|
|
self.textTono.textColor = [UIColor blackColor];
|
|
titolo.textColor = [UIColor blackColor];
|
|
|
|
}
|
|
else{
|
|
self.textTono.textColor = [UIColor grayColor];
|
|
titolo.textColor = [UIColor grayColor];
|
|
|
|
}
|
|
self.textTono.enabled = self.isAbilitato;
|
|
return cell;
|
|
|
|
}
|
|
break;*//*
|
|
case 5:{
|
|
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"impostazioniNotifiche"];
|
|
UILabel *titolo = (UILabel *)[cell viewWithTag:1];
|
|
titolo.text = self.lista[indexPath.row];
|
|
if (self.isAbilitato){
|
|
titolo.textColor = [UIColor blackColor];
|
|
}
|
|
else{
|
|
titolo.textColor = [UIColor grayColor];
|
|
}
|
|
return cell;
|
|
|
|
}
|
|
break;
|
|
case 6:{
|
|
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellaSelezioneAbilita"];
|
|
UILabel *titolo = (UILabel *)[cell viewWithTag:1];
|
|
titolo.text = self.lista[indexPath.row];
|
|
UILabel *stato = (UILabel *)[cell viewWithTag:2];
|
|
stato.text = NSLocalizedString(@"Un sisma è simulato. Dovresti ricevere l'allerta e l'allarme dovrebbe suonare. Se attive, ricordati di disabilitare l'invio della mail automatiche ai tuoi contatti per non allarmarli", @"voce menu");
|
|
cell.accessoryType = UITableViewCellAccessoryNone;
|
|
if (self.isAbilitato){
|
|
titolo.textColor = [UIColor blackColor];
|
|
stato.textColor = [UIColor blackColor];
|
|
|
|
}
|
|
else{
|
|
titolo.textColor = [UIColor grayColor];
|
|
stato.textColor = [UIColor grayColor];
|
|
|
|
}
|
|
return cell;
|
|
|
|
}
|
|
break;*/
|
|
case 5:{
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellaSelezioneAbilita"];
|
|
UILabel *titolo = (UILabel *)[cell viewWithTag:1];
|
|
titolo.text = self.lista[indexPath.row];
|
|
UILabel *stato = (UILabel *)[cell viewWithTag:2];
|
|
stato.text = NSLocalizedString(@"Suona un allarme quando un sisma è rilevato dalla rete di smartphones ", @"voce menu");
|
|
if (self.isintervalloAllarme && self.isAbilitato){
|
|
cell.accessoryType = UITableViewCellAccessoryCheckmark;
|
|
titolo.textColor = [UIColor blackColor];
|
|
stato.textColor = [UIColor blackColor];
|
|
}
|
|
else{
|
|
cell.accessoryType = UITableViewCellAccessoryNone;
|
|
titolo.textColor = [UIColor grayColor];
|
|
stato.textColor = [UIColor grayColor];
|
|
}
|
|
return cell;
|
|
|
|
}
|
|
break;
|
|
|
|
case 6:{
|
|
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"vociDettagli"];
|
|
UILabel *titolo = (UILabel *)[cell viewWithTag:1];
|
|
titolo.text = self.lista[indexPath.row];
|
|
|
|
self.textFildInizio = (UITextField *)[cell viewWithTag:2];
|
|
self.textFildInizio.delegate = self;
|
|
self.textFildInizio.inputView = self.pikerViewController.view;
|
|
self.textFildInizio.text = self.oraInizio;
|
|
self.textFildInizio.enabled = self.isintervalloAllarme;
|
|
if (self.isintervalloAllarme && self.isAbilitato) {
|
|
titolo.textColor = [UIColor blackColor];
|
|
self.textFildInizio.textColor = self.textColor;
|
|
}
|
|
else{
|
|
titolo.textColor = [UIColor grayColor];
|
|
self.textFildInizio.textColor = [UIColor grayColor];
|
|
}
|
|
|
|
self.textFildInizio.enabled = self.isAbilitato;
|
|
|
|
return cell;
|
|
|
|
}
|
|
break;
|
|
case 7:{
|
|
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"vociDettagli"];
|
|
UILabel *titolo = (UILabel *)[cell viewWithTag:1];
|
|
titolo.text = self.lista[indexPath.row];
|
|
self.textFildfine = (UITextField *)[cell viewWithTag:2];
|
|
self.textFildfine.delegate = self;
|
|
self.textFildfine.inputView = self.pikerViewController.view;
|
|
self.textFildfine.text = self.oraFine;
|
|
self.textFildfine.enabled = self.isintervalloAllarme;
|
|
if (self.isintervalloAllarme && self.isAbilitato) {
|
|
titolo.textColor = [UIColor blackColor];
|
|
self.textFildfine.textColor = self.textColor;
|
|
}
|
|
else{
|
|
titolo.textColor = [UIColor grayColor];
|
|
self.textFildfine.textColor = [UIColor grayColor];
|
|
}
|
|
|
|
self.textFildfine.enabled = self.isAbilitato;
|
|
|
|
return cell;
|
|
|
|
}
|
|
break;
|
|
default:{
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"impostazioniNotifiche"];
|
|
UILabel *titolo = (UILabel *)[cell viewWithTag:1];
|
|
titolo.text = self.lista[indexPath.row];
|
|
if (self.isAbilitato){
|
|
titolo.textColor = [UIColor blackColor];
|
|
|
|
}
|
|
else{
|
|
titolo.textColor = [UIColor grayColor];
|
|
|
|
}
|
|
return cell;
|
|
|
|
}break;
|
|
}
|
|
|
|
}
|
|
|
|
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
|
switch (indexPath.row) {
|
|
case 0:{
|
|
self.isAbilitato = !self.isAbilitato;
|
|
[EQNAllertaSismica center].isAbilitato = self.isAbilitato;
|
|
|
|
[[EQNAllertaSismica center] saveUserInfo];
|
|
[self.tableView reloadData];
|
|
}break;
|
|
case 2:{
|
|
self.isSimiSenzaIntensita = !self.isSimiSenzaIntensita;
|
|
[EQNAllertaSismica center].isSimiSenzaIntensita = self.isSimiSenzaIntensita;
|
|
[[EQNAllertaSismica center] saveUserInfo];
|
|
[self.tableView reloadData];
|
|
}break;
|
|
case 5:{
|
|
self.isintervalloAllarme = !self.isintervalloAllarme;
|
|
[EQNAllertaSismica center].isintervalloAllarme = self.isintervalloAllarme;
|
|
[[EQNAllertaSismica center] saveUserInfo];
|
|
[self.tableView reloadData];
|
|
}break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
}
|
|
|
|
# pragma textFild delegate
|
|
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField{
|
|
|
|
self.textFild = textField;
|
|
|
|
return YES;
|
|
}
|
|
|
|
# pragma mark pikerView string
|
|
|
|
-(void)inviaDati:(NSDictionary *)elementi{
|
|
|
|
NSString *elemento = elementi[@"elemento"];
|
|
// NSNumber *indice = elementi[@"indice"];
|
|
|
|
if ([elemento isEqualToString:NSLocalizedString(@"Qualsiasi distanza", @"voce elenco raggio sismi")])
|
|
elemento = @"100000";
|
|
|
|
|
|
if ([elemento isEqualToString:NSLocalizedString(@"Solo sismi forti", @"voce menu")]) {
|
|
elemento = @"1";
|
|
}
|
|
|
|
if ([elemento isEqualToString:NSLocalizedString(@"Qualsiasi intensità", @"voce menu")]) {
|
|
elemento = @"0";
|
|
}
|
|
|
|
if (self.textFild == self.textSismiNotificare)
|
|
[EQNAllertaSismica center].sismiDaNotificare = elemento;
|
|
|
|
if (self.textFild == self.textraggioSismiLievi)
|
|
[EQNAllertaSismica center].raggioSismiLievi = elemento;
|
|
|
|
if (self.textFild == self.textraggioSismiForti)
|
|
[EQNAllertaSismica center].raggioSismiForti = elemento;
|
|
|
|
if (self.textFild == self.textTono)
|
|
[EQNAllertaSismica center].tonoAllarme = elemento;
|
|
|
|
if (self.textFild == self.textSismiNotificare)
|
|
[EQNAllertaSismica center].sismiDaNotificare = elemento;
|
|
|
|
|
|
[[EQNAllertaSismica center] saveUserInfo];
|
|
|
|
[self setupView];
|
|
|
|
[self.tableView endEditing:YES];
|
|
|
|
}
|
|
|
|
-(void)chiudiView{
|
|
|
|
[self.tableView endEditing:YES];
|
|
|
|
}
|
|
|
|
# pragma mark pikerViewdata data
|
|
|
|
-(void)dataSelezionata:(NSDate *)data withTextFild:(UITextField *)textFild{
|
|
|
|
self.textFild.text = [self.dateFormatter stringFromDate:data];
|
|
if (self.textFild == self.textFildInizio)
|
|
[EQNAllertaSismica center].oraioInizio = data;
|
|
else
|
|
[EQNAllertaSismica center].orarioFine = data;
|
|
|
|
[[EQNAllertaSismica center] saveUserInfo];
|
|
[self setupView];
|
|
|
|
[self.tableView endEditing:YES];
|
|
|
|
}
|
|
|
|
-(void)esci{
|
|
|
|
[self.tableView endEditing:YES];
|
|
}
|
|
@end
|