Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/113.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIImageView拖放和触摸_Ios - Fatal编程技术网

Ios UIImageView拖放和触摸

Ios UIImageView拖放和触摸,ios,Ios,我想检测uiimageview上的拖放和触摸。 我该怎么做? 我需要在图像翻转事件中实现这样的代码。 对于图像视图的拖放操作,您必须指定手势识别器 //drag your object UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panDetected:)]; [self.imageSubVw addGestureRecog

我想检测uiimageview上的拖放和触摸。 我该怎么做? 我需要在图像翻转事件中实现这样的代码。

对于图像视图的拖放操作,您必须指定手势识别器

//drag your object
UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panDetected:)];
[self.imageSubVw addGestureRecognizer:panRecognizer];

// scale your object
UIPinchGestureRecognizer *pinchRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchDetected:)];
[self.imageSubVw addGestureRecognizer:pinchRecognizer];

// rotate your object
UIRotationGestureRecognizer *rotationRecognizer = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(rotationDetected:)];
[self.imageSubVw addGestureRecognizer:rotationRecognizer];

panRecognizer.delegate = self;
pinchRecognizer.delegate = self;
rotationRecognizer.delegate = self;

对于图像视图的拖放和触摸,您必须指定手势识别器

//drag your object
UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panDetected:)];
[self.imageSubVw addGestureRecognizer:panRecognizer];

// scale your object
UIPinchGestureRecognizer *pinchRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchDetected:)];
[self.imageSubVw addGestureRecognizer:pinchRecognizer];

// rotate your object
UIRotationGestureRecognizer *rotationRecognizer = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(rotationDetected:)];
[self.imageSubVw addGestureRecognizer:rotationRecognizer];

panRecognizer.delegate = self;
pinchRecognizer.delegate = self;
rotationRecognizer.delegate = self;