I have a GPS coordinate (latitude, longitude), and I quickly want to place one pin on MKMapView, showing this position. Everything works fine, but since I only need one output without a callout, is there a faster way to do this, or is it lower than what I need to do?
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id < MKAnnotation >)annotation { MKPinAnnotationView *pinView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"DETAILPIN_ID"]; [pinView setAnimatesDrop:YES]; [pinView setCanShowCallout:NO]; return pinView; }
Note. I don’t need to check reuse annotation views, since I use only output to show the position in the detail view (which is destroyed and recreated the next time the detail view is requested).
objective-c iphone cocoa-touch mkmapview
fuzzygoat Mar 27 2018-12-12T00: 00Z
source share