2012-09-11 134 views

回答

1

的阻力和觸摸爲您的圖片查看已分配GestureRecognizer

//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;