Learn how to support high-precision touches in your app.
UIKit usually delivers touches to your app at around 60 Hz, but some devices are capable of recording touch information at up to 240 Hz. On such devices, UIKit does not deliver the extra touch information automatically, in case the app does not need the extra data. Instead, it coalesces any extra touches into a single
UITouch object, whose location reflects only the last recorded touch. However, apps that want the extra precision can retrieve and use the additional touch information.
Figure 1 illustrates what happens when the user drags Apple Pencil across the device. At the point where UIKit reports a touch event to the app, Apple Pencil has reported four touch positions, but UIKit reports only the last touch to the app by default. The remaining three touches are delivered as coalesced touches, and the app must retrieve them explicitly to use them.
To retrieve coalesced touches, call the
coalesced method of the
UIEvent object containing the original
UITouch object. That method returns the array of all touches since the last event, including the last
UITouch object actually delivered to the app. You must retrieve coalesced touches immediately when handling an event. After handling the event, there is no guarantee that any coalesced touches will remain available.