How do I animate MKAnnotationView drop?

One problem with the code above by Anna Karenina is that it doesn’t deal with when you add annotations below where the user is looking at the moment. Those annotations will float in mid-air before dropping because they are moved into the user’s visible map rect. Another is that it also drops the user location … Read more

How to capture Tap gesture on MKMapView

You can use a UIGestureRecognizer to detect touches on the map view. Instead of a single tap, however, I would suggest looking for a double tap (UITapGestureRecognizer) or a long press (UILongPressGestureRecognizer). A single tap might interfere with the user trying to single tap on the pin or callout itself. In the place where you … Read more

MKPinAnnotationView: Are there more than three colors available?

some more 😉 And the original ones : And the code: – (MKAnnotationView*)mapView:(MKMapView*)mapView viewForAnnotation:(id <MKAnnotation>)annotation { MKPinAnnotationView* anView =[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@”test”]; anView.pinColor=MKPinAnnotationColorPurple; UIImage* image = nil; // 2.0 is for retina. Use 3.0 for iPhone6+, 1.0 for “classic” res. UIGraphicsBeginImageContextWithOptions(anView.frame.size, NO, 2.0); [anView.layer renderInContext: UIGraphicsGetCurrentContext()]; image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); NSData* imgData = UIImagePNGRepresentation(image); NSString* … Read more

tech