mcconkiee / EMHint

EMHint is an iOS class group that easily adds a spotlight-like effect to a view highlighting or hinting at something that may be important on the screen.The protocols of EMHintDelegate allow users to override many of the default actions and views. Tapping the black overlay fades it away. Great for quick "how to" or tutorials in your app.
MIT License
250 stars 30 forks source link

Spotlight needs passthrough views #4

Open alariccole opened 12 years ago

alariccole commented 12 years ago

As it is currently written, tapping on a control that is highlighted just dismisses the overlay--it does not allow the touch to register with the highlighted item. Some hit detection should be implemented, allowing the highlighted view to "pass through". It is confusing to focus the user on a control but not allow them to use that control.

mcconkiee commented 12 years ago

i've made a branch to first test if this could suffice for the functionality you note. https://github.com/mcconkiee/EMHint/tree/passthrough

Look at the example and see the new protocol method that allows a touch to "pass though": -(BOOL) hintStateShouldAllowTouchPassedThrough:(id)hintState touch:(UITouch*)touch;

alariccole commented 12 years ago

Awesome. Working for me so far. Will test this on a more complex view hierarchy--one using nested container view controllers that correctly places a UIPopoverController. Might be useful to replicate their API, allowing an array of passthrough views, but I like what you seem to be doing, which is simply setting a flag whether or not to allow pass through of the highlighted items.