0

我希望捏识别器从一开始就为每个事件工作。我的意思是我想让第一个距离 = 最后一个距离(这是根据我正在使用的模块的逻辑)。该代码用于增加或减小对象的大小。
如果我写

oldDistance = sender->_initialTouchDistance*sender.scale;

我得到链接器错误

Undefined symbols for architecture armv7:
"_OBJC_IVAR_$_UIPinchGestureRecognizer._initialTouchDistance", referenced from:
  -[DrawArea pinchTouch:] in DrawArea.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

如果写

- (void) pinchTouch: (UIPinchGestureRecognizer *) sender
{
    if (sender.state == UIGestureRecognizerStateRecognized ||
        sender.state == UIGestureRecognizerStateChanged){
        [docW touchesPinchingScale:sender.scale velosity:sender.velocity withArea:self];
        sender.scale = 1;
    }
}

那么我不确定这段代码是否正常工作。即使我的触摸速度非常快,对象的缩放也会相对缓慢。可以吗?

4

0 回答 0