objective-c - 如何比较UIView的transform属性
阿神
阿神 2017-04-21 10:57:28
0
3
472

想判断现在旋转是否是M_PI_2,应该如何比较?

赋值的时候可以
toolView.transform = CGAffineTransformMakeRotation(-M_PI_2);

但是如果这样判断就会报错。

阿神
阿神

闭关修行中......

reply all(3)
黄舟

The transform type of UIView is CGAffineTransform, which is a struct.
C language does not allow direct operations on struct. You have to compare the attributes in the struct.

洪涛

CG_EXTERN bool CGAffineTransformEqualToTransform(CGAffineTransform t1,
CGAffineTransform t2) CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
用这个比较

迷茫

If you buy me some fruit tomorrow, I will tell you how to calculate the rotation angle and scaling of the affine matrix

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template