How do I translate the following method call from ObjectiveC to RubyMotion syntax:
[self.faceView addGestureRecognizer:[
[UIPinchGestureRecognizer alloc] initWithTarget:self.faceView
action:@selector(pinch:)]];
I got this far:
self.faceView.addGestureRecognizer(
UIPinchGestureRecognizer.alloc.initWithTarget(
self.faceView, action:???))
I understand the @selector(pinch:)
indicates a delegation to the receiver object pinch
method, but how would I do this in RubyMotion? Maybe using a block?
You should be able to just use a string to specify the selector:
self.faceView.addGestureRecognizer(
UIPinchGestureRecognizer.alloc.initWithTarget(
self.faceView, action:'pinch'))