How do you find the current scale (zoom level) of a UIView
?
According to this source, using this method gives you the scale regardless of rotation or translation applied to transform:
func scale(from transform: CGAffineTransform) -> Double {
return sqrt(Double(transform.a * transform.a + transform.c * transform.c));
}
I know I am late to the party but the accepted answer didn't work in my case.