Note: Just a small design tip I am using on a project. 
When there are just too many UIGesturesRecognizers you need to use on a UIView, something I would recommend is to implement a state machine. Normally, you wouldn’t use the UIGesturesRecognizers at the same time, but at different phases like:
  • Moving subviews
  • ToolBox for the subviews
  • Resizes
  • Adding new subviews at a given location

Start by defining a typedef:

// Defines the state of the View
typedef enum {
    addFigureState = 0,
    resizeFigureState = 1,
    normalState = 2
} SCDrawViewState;

Depending on the phase you are, just [gesture setEnable:YES] or [gesture setEnable:NO]

UIView with too many UIGesturesRecognizer

Advertisements
Tagged , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: