PDA

View Full Version : How to animate SKAnnotationView



jdnessity
26.11.2015, 01:54
Hi, I would just like to know if there is a way to animate an annotation marker? So far I have used the following code with no luck:



UIView *testView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 64.0, 64.0)];
UIImageView *coloredView = [[UIImageView alloc] initWithFrame:testView.bounds];
coloredView.animationImages = [NSArray arrayWithObjects:[UIImage imageNamed:@"pulse_holo_blue-2-0-0-1"],[UIImage imageNamed:@"pulse_holo_blue-2-0-0-2"], nil];
coloredView.animationDuration = 1.0f;
[coloredView setAnimationRepeatCount:0];
[coloredView startAnimating];
[testView addSubview:coloredView];

SKAnnotationView *view = [[SKAnnotationView alloc] initWithView:testView reuseIdentifier:@"viewID"];

SKAnnotation *viewAnnotation = [SKAnnotation annotation];
viewAnnotation.annotationView = view;
viewAnnotation.identifier = 100;
viewAnnotation.location = CLLocationCoordinate2DMake(14.86, 120.20);
[self.mapView addAnnotation:viewAnnotation withAnimationSettings:animationSettings];

Adela_Silvia
14.12.2015, 16:38
Please describe a little more the scenario: how should the animated annotation look like?