mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(ios): add null check to TouchGestureRecognizer (#7182)
This commit is contained in:
committed by
Martin Yankov
parent
d35e14ed0f
commit
7d3f0d9e96
@@ -351,22 +351,30 @@ class TouchGestureRecognizer extends UIGestureRecognizer {
|
||||
|
||||
touchesBeganWithEvent(touches: NSSet<any>, event: any): void {
|
||||
this.executeCallback(TouchAction.down, touches, event);
|
||||
this.view.touchesBeganWithEvent(touches, event);
|
||||
if (this.view) {
|
||||
this.view.touchesBeganWithEvent(touches, event);
|
||||
}
|
||||
}
|
||||
|
||||
touchesMovedWithEvent(touches: NSSet<any>, event: any): void {
|
||||
this.executeCallback(TouchAction.move, touches, event);
|
||||
this.view.touchesMovedWithEvent(touches, event);
|
||||
if (this.view) {
|
||||
this.view.touchesMovedWithEvent(touches, event);
|
||||
}
|
||||
}
|
||||
|
||||
touchesEndedWithEvent(touches: NSSet<any>, event: any): void {
|
||||
this.executeCallback(TouchAction.up, touches, event);
|
||||
this.view.touchesEndedWithEvent(touches, event);
|
||||
if (this.view) {
|
||||
this.view.touchesEndedWithEvent(touches, event);
|
||||
}
|
||||
}
|
||||
|
||||
touchesCancelledWithEvent(touches: NSSet<any>, event: any): void {
|
||||
this.executeCallback(TouchAction.cancel, touches, event);
|
||||
this.view.touchesCancelledWithEvent(touches, event);
|
||||
if (this.view) {
|
||||
this.view.touchesCancelledWithEvent(touches, event);
|
||||
}
|
||||
}
|
||||
|
||||
private executeCallback(action: string, touches: NSSet<any>, event: any): void {
|
||||
|
||||
Reference in New Issue
Block a user