I'd like to animate my UIImageView with these steps:
- scale 2 times
- scaled image movement
So I'm trying like this:
UIView.animate(withDuration: 0.5, animations: {
self.imageView.transform = CGAffineTransform(scaleX: 2, y: 2)
}) { _ in
UIView.animate(withDuration: 1.0, animations: {
self.imageView.transform = CGAffineTransform(translationX: -50, y: -50)
}) { _ in
//other steps
}
}
But the result is that before moving imageView got back to previous size and then moving. How to move scaled view?
also I've tried to change layer's anchorPoint inside the animate block with no success
And maybe there is more simple way to achieve my goal: ability to zoom out image, then focus at 3 custom points, then zoom in to the initial size.
focus at 3 custom pointsdo you want?anchorPoint?