private void toTouchEvents(NSSet touches, UIEvent uiEvent) {
for (UITouch touch : (NSSet<UITouch>) touches) {
CGPoint loc = touch.getLocation(touch.getView());
synchronized(touchEvents) {
TouchEvent event = touchEventPool.obtain();
event.x = (int)(loc.x() * app.displayScaleFactor);
event.y = (int)(loc.y() * app.displayScaleFactor);
event.phase = touch.getPhase();
event.timestamp = (long)(touch.getTimestamp() * 1000000000);
touchEvents.add(event);