I have a UIImageView which I load from nib with autolayout constraints.I am trying to rotate it by 180 deg but when it's rotating it is not holding the center position of its own thus making a weird rotation path. I am rotating the image by this code
//let center = self.viewAnimate.center
UIView.animate(withDuration: 1.3, delay: 0.0, options: [.repeat,.curveEaseInOut], animations: {
//self.viewAnimate.center = center
self.viewAnimate.transform = self.viewAnimate.transform.rotated(by: CGFloat(Double.pi))
}, completion: nil)
the commented part is done when I thought may be I can force it to holder the center position it had before animation started. How can I solve this issue?