One Quickie


Adding gesture recognizers (UIView->General)
Gesture recognizers are cool. Here is how you can add them to a UIView, say at init or view loading time:
    UITapGestureRecognizer *tap =
        [[UITapGestureRecognizer alloc] initWithTarget: self
                                        action: @selector(twoByThreeTap:)];
    tap.numberOfTapsRequired = 2;
    tap.numberOfTouchesRequired = 3;
    [self addGestureRecognizer: tap];
    [tap release];
If you're not getting taps, perhaps you're using a default UIImageView, you'll probably need to turn on interaction and multitouch, either in IB or in code:
    // So we can get the taps.
    self.userInteractionEnabled = YES;
    self.multipleTouchEnabled = YES;



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com