simple swipe detection

hello together!

i want to switch the camera whenever the user swipe over the iPhone.

how can i check if there was a swipe? how can i check the distance between touchDeltaPosition and swipeDeltaPosition?

	if (Input.touchCount > 0  Input.GetTouch(0).phase == TouchPhase.Began){
	var touchDeltaPosition:Vector2 = Input.GetTouch(0).deltaPosition;
	}
	if (Input.touchCount > 0  Input.GetTouch(0).phase == TouchPhase.Moved){
	var swipeDeltaPosition:Vector2 = Input.GetTouch(0).deltaPosition;
	}

The deltaPosition value is actually the position offset since the last frame and is not ideal for detecting a swipe. You should get the position of the touch on each frame and then use Vector2.Distance to get the distance between that position and the inital touch position.