Get various coordinates for touches in swift

2211 views swift

Im trying to get the coordinates of various points when touching in a UIView for swift 4. I've seen the other post regarding a similar problem, but that code only allows the first touch to be registered. I would appreciate some help. Thanks.

answered question

1 Answer


You can implement the touchesMoved callback on your UIView subclass to do this.

func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?)

This function gets called repeatedly while the touch is ongoing.

posted this

Have an answer?


Please login first before posting an answer.