1
我有6個UIImageViews每個連接到UIPanGestureRecognizer,他們都連接到相同的方法。方法是:UIPanGestureRecognizer碰撞
- (IBAction)handlePan:(UIPanGestureRecognizer *)recognizer {
CGPoint translation = [recognizer translationInView:self.view];
recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x,
recognizer.view.center.y + translation.y);
[recognizer setTranslation:CGPointMake(0, 0) inView:self.view];
}
我在關注使用GestureRecognizers的Ray Wenderlich的教程。所以,我想知道如何檢測碰撞,以便當一幅圖像與另一幅圖像發生碰撞時,會運行一些代碼。每個圖像的代碼都不相同。
感謝
你解決了這個問題嗎? –
@SAPDEV是的,我用下面的答案。 –