想判断现在旋转是否是M_PI_2,应该如何比较?
赋值的时候可以
toolView.transform = CGAffineTransformMakeRotation(-M_PI_2);
但是如果这样判断就会报错。
黄舟2017-04-21 10:59:28
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.
PHP中文网2017-04-21 10:59:28
CG_EXTERN bool CGAffineTransformEqualToTransform(CGAffineTransform t1,
CGAffineTransform t2) CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
用这个比较
迷茫2017-04-21 10:59:28
If you buy me some fruit tomorrow, I will tell you how to calculate the rotation angle and scaling of the affine matrix