私のプロジェクトの 1 つで、1 つのビューでタッチをキャッチし、この方法で 2 番目のビューにメソッドを渡します。
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesEnded:touches withEvent:event];
// Do something here
[otherView touchesEnded:touches withEvent:event];
}
編集:タッチを管理するためだけに 3 番目の UIView を使用することもできます。
ビューの上に 3 番目の UIView を配置し (画面と同じ幅にする必要があります)、タッチを管理します。
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesEnded:touches withEvent:event];
// Get touch position
UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInView:self.view];
// Use location to pass touches to one view ot the other
if (location == something) {
[oneView touchesEnded:touches withEvent:event];
} else {
[otherView touchesEnded:touches withEvent:event];
}
}