From 18bc616166ba3ea87781dce0873efac3cc12d2af Mon Sep 17 00:00:00 2001 From: raiseCatError <315733358+raiseCatError@users.noreply.github.com> Date: Mon, 26 Oct 2026 12:52:10 +0530 Subject: [PATCH] fix(ios): build the edge-layout touch region from typed pieces Xcode 26.6's type checker gives up on the Strip/Overlay hit region in edgeLayoutContent (ReceiverControls.swift:1426): two `+` concatenations over an untyped ternary, `Optional.map { [...] } ?? []` and a `??` chain make the solver try every `+` overload together with each `??` and literal choice. Built as three [CGRect] lets ahead of the ZStack, the same rects, in the same order, reach ControlRegionShape. --- iOS/ReceiverControls.swift | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/iOS/ReceiverControls.swift b/iOS/ReceiverControls.swift index ead48fe33..f8ff3f0d9 100644 --- a/iOS/ReceiverControls.swift +++ b/iOS/ReceiverControls.swift @@ -1364,6 +1364,12 @@ extension ReceiverControlOverlay { .map { PadEdgeGeometry.circleRun(of: $0, metrics: metrics).insetBy(dx: -Self.trayPadding, dy: -Self.trayPadding) } let occupied = layout.mainSegments.map(\.frame) + layout.functionSegments.map(\.frame) + [gearFrame, paletteFrame].compactMap { $0 } + // The touch region, built from typed pieces: as one `+`/`??` chain + // inside the ZStack it exceeded Xcode 26's type-checking budget. + let mainRegion: [CGRect] = autoHiding ? [] : mainControls.filter { !$0.kind.isOneTapAction } + .map { $0.frame.insetBy(dx: -4, dy: -4) } + let gearRegion: [CGRect] = gearFrame.map { [$0.insetBy(dx: -4, dy: -4)] } ?? [] + let paletteRegion: [CGRect] = wheel.map { [$0.frame.insetBy(dx: -8, dy: -8)] } ?? paletteFrame.map { [$0] } ?? [] ZStack(alignment: .topLeading) { ForEach(Array(layout.strips.enumerated()), id: \.offset) { _, strip in @@ -1425,11 +1431,7 @@ extension ReceiverControlOverlay { // outside this region and take their own taps. Color.clear .frame(width: containerSize.width, height: containerSize.height) - .contentShape(ControlRegionShape( - rects: (autoHiding ? [] : mainControls.filter { !$0.kind.isOneTapAction } - .map { $0.frame.insetBy(dx: -4, dy: -4) }) - + (gearFrame.map { [$0.insetBy(dx: -4, dy: -4)] } ?? []) - + (wheel.map { [$0.frame.insetBy(dx: -8, dy: -8)] } ?? paletteFrame.map { [$0] } ?? []))) + .contentShape(ControlRegionShape(rects: mainRegion + gearRegion + paletteRegion)) .gesture(controlGesture()) } .onAppear {