编辑代码

let touch:UITouch = touches.first! as UITouch
print (touch.location(in: view).x)
print(touch.location(in: view).y)