Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. -(IBAction)trash:(id)sender {
  2. NSLog(@"put to trash");
  3. MyPointAnnotation *thisAnnotation = (MyPointAnnotation*)[relatedAnnotationView annotation];
  4. [thisAnnotation setFlaggedForDeletion:YES]; // deletion is managed in delegate didDeselect
  5. [thisAnnotation.pointMetadata->mapView deselectAnnotation:thisAnnotation animated:NO];
  6. }
  7.  
  8. -(void) mapView:(MKMapView *)theMapView didDeselectAnnotationView:(nonnull MKAnnotationView *)view {
  9. if (customCalloutView) {
  10. [customCalloutView removeFromSuperview];
  11. }
  12.  
  13. if([(MyPointAnnotation*)[view annotation] flaggedForDeletion]){
  14. [view removeFromSuperview];
  15. [theMapView removeAnnotation:[view annotation]];
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement