Post

Replies

Boosts

Views

Activity

Xcode_26_beta_4 iOS 26 func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView?
It looks like we're encountering a similar hitTest issue to what we had with iOS Xcode 16 + iOS 18. When running Xcode 26 + iOS 26, rootViewController?.view.subviews is returning an empty array, even though the views are clearly present in the hierarchy. Last year, we "fixed" this issue using the code attached, but it doesn't seem to work anymore with iOS 26. Any suggestions would be greatly appreciated! private class PassthroughWindow: UIWindow { override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { guard let hitView = super.hitTest(point, with: event), let rootView = rootViewController?.view else { return nil } if #available(iOS 18, *) { for subview in rootView.subviews.reversed() { let convertedPoint = subview.convert(point, from: rootView) if subview.hitTest(convertedPoint, with: event) != nil { return hitView } } return nil } else { return hitView == rootView ? nil : hitView } } }
Topic: UI Frameworks SubTopic: UIKit
2
3
114
Aug ’25