activity indicator in iOS should prevent user from access to other UI elements until it stops animating

1.9k Views Asked by At

My ActivityIndicator comes up at the right time but the user can still press the buttons on the view while processing is occurring. The reason I'm using ActivityIndicator is to prevent such usage. How do I make sure that during the animation of ActivityIndicator, no UI interaction is possible? Also, I would prefer that the current view is still displayed to the user(as in I wouldn't prefer having an opaque view of UIActivityIndicator-if that's possible-unless that's the only option)

2

There are 2 best solutions below

0
On BEST ANSWER

ActivityIndicator's job is to like names says indicate that something goes on, and not to disable all interactions...You should be the one to do that...you could try with setting userInteractionEnabled property to NO.

When everything is finished set it back to YES

0
On

Check out DSActivityView. It's a one-shot singleton that puts up a modal activity view VERY easily.

Include it in a View Controller, and then before you fire a long-running background process, you go:

[DSBezelActivityView activityViewForView:self.view];

And then when you're done and want to retire it, you go:

[DSBezelActivityView removeViewAnimated:YES];

Lots of configuration options, including the ability to put custom messages in the activity view... It's a great little library that I use ALL the time.