@epa_neto
My SHSwipeEvent only works for Sparrow 1.X and non-arc. I haven't used/tested it in awhile and I would recommend using UIGestureRecognizers for the added customization. If you insist on using it, it's easiest just to exclude the class from ARC. To exclude the file from ARC, use the -fno-objc-arc flag in build phases>compile sources. If you post the errors here, I will try to guide you on the fixes within my limited time. The fixes should just be minor changes, such as using SPViewController instead of SPView.
@ChrisDidThis:
Edit: I just realized your post was months ago, but I will leave my answer below, for future reference.
Are you using Sparrow 1.X or Sparrow 2.0? Judging by the code provided, it seems you are using Sparrow 1.X.
As ges1983 pointed out, you need to add a detectSwipe: method to your class. Also, you shouldn't be setting the "target" as the sparrowView, instead, it should be "self" (or an object that contains the method "detectSwipe:").
Without testing this code and assuming you are using Sparrow 1.X, here is my suggested changes:
- (id)initWithWidth:(float)width height:(float)height
{
if ((self = [super initWithWidth:width height:height]))
{
// this is where the code of your game will start.
// in this sample, we add just a simple quad to see if it works.
mContainer = [[SPSprite alloc]init];
mContainer.rotation = SP_D2R(90);
mContainer.x = 320;
[self addChild:mContainer];
sparrowView = (UIView *)[SPStage mainStage].nativeView;
swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(detectSwipe:)];
[swipeGesture setDirection:(UISwipeGestureRecognizerDirectionRight)];
[swipeGesture setNumberOfTouchesRequired:1];
[sparrowView addGestureRecognizer:swipeGesture];
}
return self;
}
- (void)detectSwipe:(UISwipeGestureRecognizer *)sender {
NSLog(@"detected swipe");
}
If you are still having trouble, here is an example: http://ios.biomsoft.com/2011/12/10/