Bronze Challenge Solution


#1

Finally, a Bronze Challenge that didn’t feel like a double Gold Challenge. Well, that is until I’m told I did it wrong. Basically, all I did was set the required number of taps for the first tapGesture to one, then I added a second tapGesture and set its required number of taps to 2. I set the selector to the clearAll: method with the (UIGesture *) variable added.

UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)];
[tapRecognizer setNumberOfTapsRequired:1];
[self addGestureRecognizer:tapRecognizer];
        
UITapGestureRecognizer *dblTapReconizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(clearAll:)];
[dblTapReconizer setNumberOfTapsRequired:2];
[self addGestureRecognizer:dblTapReconizer];