Annotation in MKMapView - ios

I want an animated image as annotation in my Mapview in iOS. I tried one gif image with the help of a third party library to animate, but it won't animate but it animate in normal imageview. I also tried animatedImageNamed with the help of 3 images, but it won't work. How can add animation in my annotation. I want a dot with animated layers (layers are appear and disappear). Just like attached image

Related

tvOS: UIImageView with rounded corners without losing the focus animation

I am displaying a collection view with an UIImageView for each cell. My images are being animated on cell focus (the standard animation where the image pops out).
However, I also need to round the corners of the image by setting the imageView.layer.cornerRadius. The problem is that once I set maskToBounds = true my imageView stops popping out on focus and without that I cannot achieve the rounded corners.
I’ve checked in other SO questions and some people suggested post-process the image in runtime using Core Graphics but this is too much processing for my collectionView.
Is there any alternative to achieve this? (The iTunes movie app does it, so I suppose there must be)
Setting maskToBounds crops the image when focused because the cell extends out of its bounds to get the parallax animation.
The issue is that to generate rounded corners with that method you need to set maskToBounds to true.
So... your final goal could be achieved using a different method to generate rounded corners, via CoreGraphics for example, that does not require setting maskToBounds.
Or, what I am personally doing, to use this open source library, which allows adding parallax effect to any UIView https://github.com/PGSSoft/ParallaxView

How to make a animation like Swipe

How to make a swipe animation like shown in the images. I guess it uses CALayer but not sure.
For the arrow image, you can use UIImage animatedImage(with:duration:)
animatedImageWithDuration
You can provide multiple images and a timespan and the image will animate

CAShapeLayer not tapable when above UIScrollView

I have a UIScrollView that has a circular shape and inside it there is a image placed on the screen and above the UIScrollView shape to the right side of it.
I also have a CAShapeLayer that has a circular shape too that is overlapping a little, becouse i want it to look like that.
The problem is my touchesBegan cant detect tap in the overlapping area of the CAShapeLayer.
I want to be able to scroll the image inside UIScrollView while be able to tap the whole area of the CAShapeLayer object with objective c.
Please help me and show me how... i don't know how to do it.. have searched in 4 days.. but i can't find a way.

Add MKAnnotation on top of UIImageView

I ran into a problem while building a map app. I'm trying to do the following:
add an animated PNG sequence as overlay to the map so that it appears to be "on the map" while the user changing the zoom, rotation and pitch of the map.
on top of that PNG sequence I would like to show a custom pin image, using MKAnnotationView.
So far, what I've been able to do is:
Load PNG sequence into an UIImageView and animate them.
add the UIImageView to the MKMapView, using addSubView:.
Detect changes to the MKMapView and update the position of UIImageView accordingly
However, if I start adding MKAnnotations to the MapView, they get added below my UIImageView (see image on the left).
Is there a way to add them on top of the UIImageView (see image on the right)?
?

How to use animated custom Pin (gif image) inside Mapview?

I want to add multiple pins on map which should remain animated continuously. Below are sample images which I want to use as Pin,
Is there any possible way to get this type of animated pin within MapKit? If possible then please suggest me appropriate way for it.
As per my knowledge it is quite tough to implement. You can easily implement animation on any UIImageView but when you add any image on custom image then you can change custom pin image via using KVO or via NSTimer.
Please follow Animation with MapView Custom Pin link to better understanding with custom pin annotation.
You can change pin image too after a certain period of time like as Zooming change pin image
and Custom pin animation - MKMapView.
I hope it will help you to better understanding. Thanks
You could create a custom MKAnnotationView and give it a UIImageView as a subview.
Then, split the GIF into separate frames, to use in the UIImageView, as documented in this SO question.

Resources