#if OBJC
- (NSArray*)UITouchToPoint:(UITouch*)t :(UIView*)view {
CGPoint p = [t locationInView:view];
return @[@(p.x), @(p.y)];
}
@end
@implementation B4IPanelView (override)
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
if (self.multipleTouchEnabled) {
if ([B4IObjectWrapper raiseEvent:self :@"_multitouchbegan:" :@[[touches allObjects]]] == false)
[super touchesMoved:touches withEvent:event];
} else {
for (UITouch *u in touches) {
CGPoint p = [u locationInView:self];
[B4IObjectWrapper raiseEvent:self :@"_touch:::" :@[@0, @(p.x), @(p.y)]];
}
}
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
if (self.multipleTouchEnabled) {
if ([B4IObjectWrapper raiseEvent:self :@"_multitouchmoved:" :@[[touches allObjects]]] == false)
[super touchesMoved:touches withEvent:event];
} else {
for (UITouch *u in touches) {
CGPoint p = [u locationInView:self];
[B4IObjectWrapper raiseEvent:self :@"_touch:::" :@[@2, @(p.x), @(p.y)]];
}
}
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
if (self.multipleTouchEnabled) {
if ([B4IObjectWrapper raiseEvent:self :@"_multitouchended:" :@[[touches allObjects]]] == false)
[super touchesMoved:touches withEvent:event];
} else {
for (UITouch *u in touches) {
CGPoint p = [u locationInView:self];
[B4IObjectWrapper raiseEvent:self :@"_touch:::" :@[@1, @(p.x), @(p.y)]];
}
}
}
#End If