long array = NSSetExtensions.allObjects(touches);
int length = (int) NSArrayExtensions.count(array);
for (int i = 0; i < length; i++) {
long touchHandle = NSArrayExtensions.objectAtIndex$(array, i);
UITouch touch = UI_TOUCH_WRAPPER.wrap(touchHandle);
CGPoint loc = touch.getLocation(touch.getView());
synchronized(touchEvents) {
UITouchPhase phase = touch.getPhase();
TouchEvent event = touchEventPool.obtain();
event.x = (int)(loc.x() * app.displayScaleFactor);
event.y = (int)(loc.y() * app.displayScaleFactor);
event.phase = phase;
event.timestamp = (long)(touch.getTimestamp() * 1000000000);
touchEvents.add(event);
if(phase == UITouchPhase.Began) {