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 {