MKMapView triggers additional hitTest

On iPhone 14 Pro running iOS 17.4.1, tapping on MKMapView triggers a dozen or more additional hitTest calls. At the moment, only one device has encountered this issue.Not sure if it's a hardware issue or a bug with MKMapView. Adding MKMapView to the app could potentially cause multiple hitTest calls on views across other pages.

  • It can be confirmed that it's not an issue with my app. Even in a newly created test project with only MKMapView added, the problem persists.

  • The additional callbacks of hitTest within the same lifecycle have the same point and frequency.

Add a Comment

Replies


public class TestView: MKMapView {

    public override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {

        let view = super.hitTest(point, with: event)

        // repeated callbacks

        return view

    }

}