Posts

Showing posts with the label core-animation

Swift: change UIImageView image midway during animation

Swift: change UIImageView image midway during animation I have this code to create animation imageView : imageView imageView.layer.anchorPoint = CGPoint(x: 0, y: 0.5) var transform = CATransform3DIdentity transform.m34 = -0.001 imageView.layer.transform = transform UIView.animate(withDuration: 3) { self.imageView.layer.transform = CATransform3DRotate(transform, .pi, 0, 1, 0) self.imageViewCenterConstraintX.constant = 0 self.view.layoutIfNeeded() } In this code imageView rotate with 180 degrees. I want to change image after imageView rotate with 90 degrees. imageView imageView pi/2 u can do in params – Abhishek Thapliyal Jul 1 at 10:46 @AbhishekThapliyal And how do I write this in the code? How to let the device know that the ima...