how handle left/right swipes?
If there's only one swiper attached to a box, how to handle left AND right swipes?
I meant - is it a more common case that a box can be swiped in only 1 direction? Does it not make more sense to have 4 recongizers attached to the box, and onSwipe to receive as a param the current direction for example?
MGBox is providing a standard unmodified UISwipeGestureRecognizer. You'll want to configure the direction property:
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UISwipeGestureRecognizer_Class/Reference/Reference.html#//apple_ref/occ/instp/UISwipeGestureRecognizer/direction
My preference would be for swipe gesture recognisers to optionally allow multiple swipe directions. I think the way Apple have done it is unnecessarily limiting. But certainly you could get around it by attaching additional recognisers and setting their action to the swiped method.
Alternatively MGBox could be modified to have onSwipedRight, onSwipedLeft, etc. That might be the better path, because it would make it explicit which direction the swipe was in.
Yeah, same direction of thought that I have ... like for my current project I just attached another gesture recogniser to the same box, but I realized I can't use the same onSwipe block to handle both, because then I don't know which direction the swipe was ...
I think onSwipedRight, onSwipedLeft, etc. is the right way
An idea that just occurred to me, and that hasn't been thought out at all, so might be really stupid, is that all the gesture and tap handlers could be moved to a UIView category, thus decoupling them from MGBox and making them much more broadly usable.
Something to think about.
Anyway, the next time the onSwipe left/right limitation hits me I'll get that one fixed. It's silly.