From b5ec25f4238909ab8acbdd89cdd1bdb5be585bdf Mon Sep 17 00:00:00 2001 From: Hristo Hristov Date: Tue, 11 Oct 2016 13:28:02 +0300 Subject: [PATCH] Fix gestures support for iOS 10 --- tns-core-modules/ui/gestures/gestures.ios.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tns-core-modules/ui/gestures/gestures.ios.ts b/tns-core-modules/ui/gestures/gestures.ios.ts index af11cdd7e..46727cdf1 100644 --- a/tns-core-modules/ui/gestures/gestures.ios.ts +++ b/tns-core-modules/ui/gestures/gestures.ios.ts @@ -4,6 +4,8 @@ import view = require("ui/core/view"); import observable = require("data/observable"); import trace = require("trace"); import types = require("utils/types"); +import utils = require("utils/utils"); +import getter = utils.ios.getter; global.moduleMerge(common, exports); @@ -413,14 +415,14 @@ class TouchGestureEventData implements definition.TouchGestureEventData { android: any = undefined; action: string; view: view.View; - ios: { touches: NSSet, event: { allTouches: () => NSSet } }; + ios: { touches: NSSet, event: UIEvent }; object: any; private _activePointers: Array; private _allPointers: Array; private _mainPointer: UITouch; - public prepare(view: view.View, action: string, touches: NSSet, event: any) { + public prepare(view: view.View, action: string, touches: NSSet, event: UIEvent) { this.action = action; this.view = view; this.object = view; @@ -435,7 +437,7 @@ class TouchGestureEventData implements definition.TouchGestureEventData { } getPointerCount(): number { - return this.ios.event.allTouches().count; + return getter(this.ios.event, this.ios.event.allTouches).count; } private getMainPointer(): UITouch { @@ -461,7 +463,7 @@ class TouchGestureEventData implements definition.TouchGestureEventData { if (!this._allPointers) { this._allPointers = []; - let nsArr = this.ios.event.allTouches().allObjects; + let nsArr = getter(this.ios.event, this.ios.event.allTouches).allObjects; for (var i = 0; i < nsArr.count; i++) { this._allPointers.push(new Pointer(nsArr.objectAtIndex(i), this.view)); }