日々精進

新しく学んだことを書き留めていきます

UITouchがあるView内にあるかどうかを判定する

以下のコードで判定できる。

CGPoint touchLocation = [touch locationInView:self];
 if (CGRectContainsPoint(myImageView.frame, touchLocation))

参考:http://stackoverflow.com/questions/2221367/comparing-a-uitouch-location-to-uiimageview-rectangle