我有一个程序,其中CALayer必须旋转到一定值.如何确定CALayer的当前旋转?我有一个旋转图层的UIRotationGestureRecognizer:
- (void)handleGesture:(UIGestureRecognizer *)gestureRecognizer
{
if (gestureRecognizer == rotationGestureRecognizer) {
NSLog(@"gestureRecRotation: %f", rotationGestureRecognizer.rotation);
CATransform3D current = _baseLayer.transform;
_baseLayer.transform = CATransform3DRotate(current, rotationGestureRecognizer.rotation * M_PI / 180, 0, 0, 1.0);
}
}
Run Code Online (Sandbox Code Playgroud)
我从一个必须旋转一定量以适应拼图的图层开始.那么如何获得图层的当前旋转?
在我的应用中,我有时会收到此错误:
objc[3899]: __weak variable at 0x610000056bd0 holds 0x10003 instead of 0x610000302640. This is probably incorrect use of objc_storeWeak() and objc_loadWeak(). Break on objc_weak_error to debug.
Run Code Online (Sandbox Code Playgroud)
如何在"objc_weak_error"上设置中断.我应该这样设置吗?
可能不是,我尝试使用和不使用引号.当错误发生时我没有休息,有些事情是不对的.
我试图将IOS文本标签旋转180度.当我尝试旋转标签时:
[timeField layer].transform = CATransform3DMakeRotation(M_PI, 1.0, 0.0, 0.0);
Run Code Online (Sandbox Code Playgroud)
所有单独的字符都单独旋转,因此生成的文本将被镜像.如何在没有字符镜像顺序的情况下旋转整个标签?当我做动画时,旋转是可以的.