Question

I have a UIView which contains almost 10 buttons which performs different actions. The user will be able to touch or tap on any button to perform a required action. But, i am getting a problem when the user presses multiple buttons at the same time. When two buttons are pressed at the same time(simultaneously) two actions are getting performed. Some times the app is getting crashed. So, i dont want the user to tap multiple buttons simultaneously. Is there any way in which i can ask a view to recognize only single touch instead of multiple touches or at least can i increase the time gap between multiple touch gestures...

Was it helpful?

Solution

This is a similar post, which has a nice solution. You essentially just hook up all the buttons to the same method, and have a switch statement. Hope that Helps!

OTHER TIPS

Use button.exclusiveTouch = YES; on each of your buttons. You will need to hook them up to UIButtons and set the property in viewDidLoad for example

Try yourView.multipleTouchEnabled = NO;

"yourView" here is the view contents all of your buttons.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top