diff --git a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_settings.imageset/Contents.json b/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_settings.imageset/Contents.json deleted file mode 100644 index bdc30c5..0000000 --- a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_settings.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "ic_action_settings.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "ic_action_settings @2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "ic_action_settings @3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_settings.imageset/ic_action_settings @2x.png b/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_settings.imageset/ic_action_settings @2x.png deleted file mode 100644 index 068ddc0..0000000 Binary files a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_settings.imageset/ic_action_settings @2x.png and /dev/null differ diff --git a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_settings.imageset/ic_action_settings @3x.png b/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_settings.imageset/ic_action_settings @3x.png deleted file mode 100644 index d26d9dc..0000000 Binary files a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_settings.imageset/ic_action_settings @3x.png and /dev/null differ diff --git a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_settings.imageset/ic_action_settings.png b/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_settings.imageset/ic_action_settings.png deleted file mode 100644 index e408740..0000000 Binary files a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_settings.imageset/ic_action_settings.png and /dev/null differ diff --git a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_share.imageset/Contents.json b/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_share.imageset/Contents.json deleted file mode 100644 index 8ac27fb..0000000 --- a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_share.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "ic_action_share.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "ic_action_share copia.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "ic_action_share copia2.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_share.imageset/ic_action_share copia.png b/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_share.imageset/ic_action_share copia.png deleted file mode 100644 index 407d951..0000000 Binary files a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_share.imageset/ic_action_share copia.png and /dev/null differ diff --git a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_share.imageset/ic_action_share copia2.png b/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_share.imageset/ic_action_share copia2.png deleted file mode 100644 index bd52c4a..0000000 Binary files a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_share.imageset/ic_action_share copia2.png and /dev/null differ diff --git a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_share.imageset/ic_action_share.png b/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_share.imageset/ic_action_share.png deleted file mode 100644 index 7c9a4ca..0000000 Binary files a/Sources/Earthquake Network/Resources/Assets.xcassets/ic_action_share.imageset/ic_action_share.png and /dev/null differ diff --git a/Sources/Earthquake Network/ViewController/Dettagli mappa/DettagliMappaViewController.m b/Sources/Earthquake Network/ViewController/Dettagli mappa/DettagliMappaViewController.m index acd6433..7373ce9 100644 --- a/Sources/Earthquake Network/ViewController/Dettagli mappa/DettagliMappaViewController.m +++ b/Sources/Earthquake Network/ViewController/Dettagli mappa/DettagliMappaViewController.m @@ -18,10 +18,12 @@ @implementation DettagliMappaViewController -- (void)viewDidLoad { +#pragma mark - View Lifecycle + +- (void)viewDidLoad +{ [super viewDidLoad]; // Do any additional setup after loading the view. - // coordinate -33.86,151.20 at zoom level 6. UIView *viewNavigationBar = [[UIView alloc] initWithFrame:CGRectMake(-18, 5, 150, 44)]; UIImageView *imageLogo = [[UIImageView alloc] initWithFrame:CGRectMake(-18, 5, 38, 38)]; imageLogo.image = [UIImage imageNamed:@"distquake_app_wave"]; @@ -33,7 +35,6 @@ [[UINavigationBar appearance] setBarTintColor:COLORE_BARRA_NAVIGAZIONE]; [[UINavigationBar appearance] setTranslucent:NO]; - // self.navigationItem.rightBarButtonItems = [self generePulsantiTipoMappa]; self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back"] style:UIBarButtonItemStyleDone target:self @@ -42,31 +43,12 @@ self.pikerViewController = [[PickerViewController alloc] initWithNibName:@"PickerViewController" bundle:nil dati:self.filtroArray]; self.pikerViewController.delegate = self; - /* - switch (self.tipoMappa) { - case reteSmartphone: - [self setUpMappaReteSmartphone]; - break; - case reteSismica: - [self setUpMappaReteSismica]; - break; - default: - break; - }*/ - -} --(void)chiudi:(id)sender{ - - [self dismissViewControllerAnimated:YES completion:nil]; -} --(void)setUpMappaReteSmartphone{ - - - } --(void)setUpSegnalazioniUtente{ - +#pragma mark - Private + +- (void)setUpSegnalazioniUtente +{ self.labelAzione.text = NSLocalizedString(@"Un giorno", @""); NSArray *lista = [EQNManager defaultManager].elencoSelagnazioniManuali; unsigned unitFlags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay; @@ -118,13 +100,8 @@ } --(void)setUpMappaReteSismica{ - - - -} - --(void)creaMarcherWithSegnalazione:(id)segnalazione{ +- (void)creaMarcherWithSegnalazione:(id)segnalazione +{ /* if(!self.annotationArray) self.annotationArray = [NSMutableArray array]; @@ -134,7 +111,9 @@ } --(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id)annotation{ +#pragma mark - MKMapViewDelegate + +- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id)annotation{ /* if ([annotation isKindOfClass:[ReteSismicaAnnotation class]]) { ReteSismicaAnnotation *anLocation = (ReteSismicaAnnotation *)annotation; @@ -149,44 +128,17 @@ else*/ return nil; } - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} --(NSArray *)generePulsantiTipoMappa{ +#pragma mark - Actions + +- (void)chiudi:(id)sender +{ - UIBarButtonItem *item1; - UIBarButtonItem *item2; - switch (self.tipoMappa) { - case reteSmartphone:{ - item1 = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ic_action_settings"] style:UIBarButtonItemStyleDone - target:self - action:@selector(setting)]; - - item2 = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ic_action_share"] style:UIBarButtonItemStyleDone - target:self - action:@selector(condividi)]; - return @[item2, item1]; - } - break; - case reteSismica: - return nil; - - break; - case segnalazioneUtenti: - return nil; - - break; - default: - return nil; - break; - } + [self dismissViewControllerAnimated:YES completion:nil]; } --(IBAction)visualizzaPikerFiltro:(id)sender{ - +- (IBAction)visualizzaPikerFiltro:(id)sender +{ [self addChildViewController:self.pikerViewController]; [self.view addSubview:self.pikerViewController.view]; UIView *subView=self.pikerViewController.view; @@ -245,7 +197,8 @@ } --(void)applicaFiltroWithTime:(NSNumber *)time{ +- (void)applicaFiltroWithTime:(NSNumber *)time +{ /* NSArray *array = [EQNUtility applicaFiltroWithTime:unAnno withList:[EQNManager defaultManager].datiPastQuakes]; EQNSegnalazione *segnalazione = array[0]; @@ -266,8 +219,8 @@ } #pragma mark - PikerControl delegate --(void)inviaDati:(NSDictionary *)elementi{ - +- (void)inviaDati:(NSDictionary *)elementi +{ [self.pikerViewController.view removeFromSuperview]; [self.pikerViewController removeFromParentViewController]; NSNumber *index = elementi[@"indice"]; @@ -275,19 +228,10 @@ [self applicaFiltroWithTime:index]; } --(void)chiudiView{ - +- (void)chiudiView +{ [self.pikerViewController.view removeFromSuperview]; [self.pikerViewController removeFromParentViewController]; } -/* -#pragma mark - Navigation - -// In a storyboard-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. -} -*/ @end diff --git a/Sources/Earthquake Network/ViewController/Dettagli mappa/PastquakesDettagliMappa.m b/Sources/Earthquake Network/ViewController/Dettagli mappa/PastquakesDettagliMappa.m index 6184fff..4a1ac6e 100644 --- a/Sources/Earthquake Network/ViewController/Dettagli mappa/PastquakesDettagliMappa.m +++ b/Sources/Earthquake Network/ViewController/Dettagli mappa/PastquakesDettagliMappa.m @@ -18,23 +18,16 @@ @implementation PastquakesDettagliMappa -- (void)viewDidLoad { +#pragma mark - View Lifecycle + +- (void)viewDidLoad +{ self.filtroArray = @[NSLocalizedString(@"Ultimo anno", @""), NSLocalizedString(@"Ultimo mese", @""),NSLocalizedString(@"Ultima settimana", @""),NSLocalizedString(@"Ultimo giorno", @""),NSLocalizedString(@"Ultim\'ora", @"")]; [super viewDidLoad]; // Do any additional setup after loading the view. - /* UIBarButtonItem *item1 = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ic_action_settings"] - style:UIBarButtonItemStyleDone - target:self - action:@selector(setting)]; - - UIBarButtonItem *item2 = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ic_action_share"] - style:UIBarButtonItemStyleDone - target:self - action:@selector(condividi)]; - self.navigationItem.rightBarButtonItems = @[item2, item1];*/ self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back"] style:UIBarButtonItemStyleDone @@ -43,30 +36,14 @@ self.mapView.delegate = self; - //NSArray *lista = [EQNUtility applicaFiltroWithTime:unGiorno withList:[EQNManager defaultManager].datiPastQuakes]; -/* - EQNPastquakes *segnalazione = lista[0]; - CLLocation *coordinate = [[CLLocation alloc] initWithLatitude:[segnalazione.latitude doubleValue] longitude:[segnalazione.longitude doubleValue]]; - MKCoordinateSpan span = MKCoordinateSpanMake(10.5, 10.5); - MKCoordinateRegion region = MKCoordinateRegionMake(coordinate.coordinate, span); - [self.mapView setCenterCoordinate:coordinate.coordinate animated:NO]; - [self.mapView setRegion:region animated:YES]; - self.mapView.scrollEnabled = NO;*/ - - [self.buttonAzione addTarget:self action:@selector(visualizzaPikerFiltro:) forControlEvents:UIControlEventTouchDown]; [self applicaFiltroWithTime:@(2)]; self.bannerView = [EQNUtility ottieniBannerWithController:self position:NO]; } -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - --(void)creaMarcherWithSegnalazione:(id)segnalazione{ - +- (void)creaMarcherWithSegnalazione:(id)segnalazione +{ [super creaMarcherWithSegnalazione:segnalazione]; if(!self.annotationArray) @@ -77,12 +54,12 @@ CLLocationCoordinate2D location = CLLocationCoordinate2DMake([pasq.latitude doubleValue], [pasq.longitude doubleValue]); PastquakesAnnotation *anAnnotation = [[PastquakesAnnotation alloc] initWithTitle:[NSString stringWithFormat:@"%@ %@ %@",NSLocalizedString(@"Sisma rilevato da", @"") ,pasq.users, NSLocalizedString(@"smartphones", @"")] location:location intensita:[pasq.intensity intValue]]; [self.annotationArray addObject:anAnnotation]; - } --(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id)annotation{ - - +#pragma mark - MKMapViewDelegate + +- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id)annotation +{ if ([annotation isKindOfClass:[PastquakesAnnotation class]]) { PastquakesAnnotation *anLocation = (PastquakesAnnotation *)annotation; MKAnnotationView *annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:IDENTIFIER_ANNOTATION_PASTQUAKES]; @@ -95,13 +72,10 @@ } else return nil; - - } - --(void)applicaFiltroWithTime:(NSNumber *)time{ - +- (void)applicaFiltroWithTime:(NSNumber *)time +{ EQNFiltriMappa filtro = unGiorno; switch ([time intValue]) { case 0: @@ -125,13 +99,6 @@ NSArray *lista = [EQNUtility applicaFiltroWithTime:filtro withList:[EQNManager defaultManager].datiPastQuakes]; - // EQNPastquakes *segnalazione = lista[0]; - // CLLocation *coordinate = [[CLLocation alloc] initWithLatitude:[segnalazione.latitude doubleValue] longitude:[segnalazione.longitude doubleValue]]; - // MKCoordinateSpan span = MKCoordinateSpanMake(10.5, 10.5); - // MKCoordinateRegion region = MKCoordinateRegionMake(coordinate.coordinate, span); - // [self.mapView setCenterCoordinate:coordinate.coordinate animated:NO]; - // [self.mapView setRegion:region animated:YES]; - self.mapView.scrollEnabled = YES; [self.annotationArray removeAllObjects]; @@ -144,25 +111,6 @@ [self.mapView addAnnotations:self.annotationArray]; [self.mapView showAnnotations:self.annotationArray animated:YES]; self.labelAzione.text = self.filtroArray[[time intValue]]; - /* - MKMapRect zoomRect = MKMapRectNull; - for (id annotation in self.mapView .annotations) - { - MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate); - MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0.1, 0.1); - zoomRect = MKMapRectUnion(zoomRect, pointRect); - } - [mapView setVisibleMapRect:zoomRect animated:YES];*/ - } -/* -#pragma mark - Navigation - -// In a storyboard-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. -} -*/ @end diff --git a/Sources/Earthquake Network/ViewController/inputView/PickerViewController.m b/Sources/Earthquake Network/ViewController/inputView/PickerViewController.m index a03f59e..4ac1f98 100644 --- a/Sources/Earthquake Network/ViewController/inputView/PickerViewController.m +++ b/Sources/Earthquake Network/ViewController/inputView/PickerViewController.m @@ -63,10 +63,7 @@ NSDictionary *dict = @{@"indice":indiceElemento, @"elemento" : elemento}; [self.delegate inviaDati:dict]; } -- (void)viewDidUnload { - [self setPickerController:nil]; - [super viewDidUnload]; -} + #pragma mark UIPickerViewDataSource - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{ diff --git a/Sources/Earthquake Network/ViewController/inputView/TBDInputViewControllerData.m b/Sources/Earthquake Network/ViewController/inputView/TBDInputViewControllerData.m index 824fe1b..f4da387 100644 --- a/Sources/Earthquake Network/ViewController/inputView/TBDInputViewControllerData.m +++ b/Sources/Earthquake Network/ViewController/inputView/TBDInputViewControllerData.m @@ -34,13 +34,6 @@ [self.confermaButton setTitle:NSLocalizedString(@"Seleziona", @"")]; } - -- (void)viewDidUnload -{ - [super viewDidUnload]; - // Release any retained subviews of the main view. -} - - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) || (interfaceOrientation == UIInterfaceOrientationPortrait); @@ -55,9 +48,4 @@ } -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; -} - - @end