views:

327

answers:

1

I have a main view that has has two buttons on it that control methods to display the next image and display the previous image. In this case the 'Image' is a class that inherits from UIImageView and has multiple pictures on it that you can interact with, and I call this class a 'Pane'. The pane itself handles all the user interaction itself while the main view controls the display of next and previous panes with the buttons. Here is my dilemma, because the pane fully covers the main view it wont allow for the user to tap the buttons on the main view! So once a pane pops up you cannot change it via the buttons! Is there a way to allow touches through transparent parts of a view, or if not how in the world do I achieve this?!

I cannot pass touchesBegan or any of those methods from the pane to the superview because all of the button touch methods are created in the xib file.

I cannot insert the pane under the control panel because then you wouldn't be able to interact with the pane. And as far as I know theres no way to pass touch events to every single pane within the paneHoldingArray that belongs to the main view

I cannot add the command buttons inside of the pane because I want to be able to replace the command button's image with a thumbprint render of the next/previous pane.

I've been stuck on this for a very long time, please somebody help me out with a fix action or a new way to re-engineer the code so that it will work!

A: 

If you want the buttons to capture events, then layer them above the pane. You say you cannot put the control panel above the pane, so break the buttons out into another view that you can put above the pane. If you want the buttons to appear under other views, then make some completely transparent custom buttons to handle you actions that you can layer on top.

I don't know what you mean by the button touch methods are created in the xib file, but in general you cannot effectively pass touch events around. You must organize the view hierarchy so that the views you want to receive events are logically on top. However, nothing says that the views on top have to be opaque or even visible.

drawnonward
If I break the buttons into another view and place it above the pane we now have the same situation as earlier where you cannot interact with the pane because the new button view is blocking interaction to views below it
Parad0x13
So you want one touch to trigger two actions by interacting with two views simultaneously?
drawnonward
Yes pretty much
Parad0x13