Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

blocking user interaction with underlying views

In my app, i have an overlay view, which is displayed when some processing and networking is happening. It is just a semitransparent view (subclass of UIView) with a loading indicator on it, filling the whole screen.

I want to prevent any of the underlying views to recieve user-interaction (e.g. a underlying table view should not be scrolled, a button not be pressed).

What is the best way i can do this from within the overlay view?

like image 677
Ahti Avatar asked Sep 01 '11 14:09

Ahti


2 Answers

Just set the userInteractionEnabled property for the overlay view to YES. This will cause all touch events to occur on the overlay view and not be passed to the underlying views.

like image 144
Evan Mulawski Avatar answered Oct 15 '22 01:10

Evan Mulawski


Just set property userInteractionEnabled of your semitransparent overlay view to YES.

like image 4
Nekto Avatar answered Oct 15 '22 02:10

Nekto