From 14b96856c095ffbc20dc9869eb7eafbde6972b03 Mon Sep 17 00:00:00 2001 From: Duy Tran Khanh <40482367+khanhduytran0@users.noreply.github.com> Date: Wed, 13 Jan 2021 13:13:42 +0700 Subject: [PATCH] Update ViewController.m --- Natives/ViewController.m | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Natives/ViewController.m b/Natives/ViewController.m index db905d07..65bf8d63 100644 --- a/Natives/ViewController.m +++ b/Natives/ViewController.m @@ -13,13 +13,6 @@ @end -void sendTouchEvent(NSSet* touches, int event) { - UITouch* touchEvent = [touches anyObject]; - CGPoint locationInView = [touchEvent locationInView:self.view]; - CGPoint normalizedPoint = getNormalizedPoint(self.view, locationInView); - callback_ViewController_onTouch(event, normalizedPoint.x, normalizedPoint.y); -} - @implementation ViewController - (void)viewDidLoad @@ -74,6 +67,13 @@ void sendTouchEvent(NSSet* touches, int event) { callback_AppDelegate_didFinishLaunching(width_c, height_c); } +void sendTouchEvent(NSSet* touches, int event) { + UITouch* touchEvent = [touches anyObject]; + CGPoint locationInView = [touchEvent locationInView:self.view]; + CGPoint normalizedPoint = getNormalizedPoint(self.view, locationInView); + callback_ViewController_onTouch(event, normalizedPoint.x, normalizedPoint.y); +} + // Equals to Android ACTION_DOWN - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {