Block the user's interaction momentarily swift

0

I need that when I click on an option in a side menu, the user's interaction is disabled until the view is loaded.

If you do not block it, the view is loaded as many times as clicks have been made on the menu.

I've tried this:

UIApplication.shared.beginIgnoringInteractionEvents()

but it does not work

    
asked by 18.10.2016 в 11:19
source

2 answers

1

If you want to block interaction with the app until the movement is over you can do it by:

 UIApplication.sharedApplication().windows.first?.userInteractionEnabled = false

I do not recommend it but it's an option and you can call it from anywhere.

    
answered by 18.10.2016 / 16:44
source
0

Yp use that function when I call a menu but I agreed with an activity indicator, however why do not you try to block the interaction of the element itself so that they can not click on it and activate it again when the load finishes?

Look at this

touch.view.userInteractionEnabled = false

or even from the container view itself.

    
answered by 19.10.2017 в 13:08