To test the scaling of your view, we just need to check if its transform not an identity transformation.
BOOL isScaled = ! CGAffineTransformIsIdentity(pageShadowView.transform);
It should be noted that this check will be valid only if you do not use other types of transformation, that is, rotation or translation.
Scaling a UIView to a specific width and height is also easy:
CGFloat yourDesiredWidth = 200.0; CGFloat yourDesiredHeight = 300.0; CGAffineTransform scalingTransform; scalingTransform = CGAffineTransformMakeScale(yourDesiredWidth/pageShadowView.bounds.size.width, yourDesiredHeight/pageShadowView.bounds.size.height); pageShadowView.transform = scalingTransform;
It is important to check for UIView bounds instead of frame , because frame not valid when converting UIView .
source share