让旋转手势和缩放手势同时作用

需要实现代理类UIGestureRecognizerDelegate

然后指定手势对象的代理类

pinchGes.delegate=self;

rotGes.delegate=self;

然后实现函数

//是否可以同时响应两个手势如果是yes就可以

-(BOOL)gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer*)otherGestureRecognizer{

returnYES;

}

你可能感兴趣的:(让旋转手势和缩放手势同时作用)