A subtle but frustrating issue in iOS 26’s Liquid Glass system can silently disable taps on adjacent buttons, leaving developers scratching their heads. After deploying a login screen with two buttons styled using the new .glassEffect() API, one button mysteriously stopped responding to taps—no errors, no crashes, just dead interaction. The culprit? An unexpected merging of glass surfaces that rerouted gesture handlers behind the scenes.
How adjacent buttons break in iOS 26
A common SwiftUI setup involves stacking two buttons vertically with a small gap, each wrapped in .glassEffect(.clear.interactive()) and .buttonStyle(.plain). The first button works perfectly, but the second remains unresponsive despite identical modifiers and styling. The issue stems from how iOS 26’s Liquid Glass engine treats .glassEffect() views.
When the in: parameter is omitted, the glass effect defaults to a rectangle. If two rectangles are close enough—like two buttons spaced 26 points apart—the system merges them into a single interactive surface. This merging is intentional for fluidity, but it introduces a side effect: taps are routed to the first view in the hierarchy, effectively silencing the second button without any visible feedback.
The fix: define a shape to prevent merging
Apple’s solution is simple but easy to overlook: explicitly define a shape for each glass effect using the in: parameter. For buttons with rounded corners, .capsule works well:
// Before (broken)
.glassEffect(.clear.interactive())
// After (fixed)
.glassEffect(.clear.interactive(), in: .capsule)By assigning distinct shapes, each button maintains its own gesture handler, ensuring all taps reach their intended targets. This small change restores functionality without altering the visual design.
Creating a reusable modifier for backward compatibility
If your app supports earlier iOS versions, wrap the glass effect in a ViewModifier that adapts based on availability:
struct GlassButtonModifier: ViewModifier {
func body(content: Content) -> some View {
if #available(iOS 26.0, *) {
content.glassEffect(.clear.interactive(), in: .capsule)
} else {
content
.background(.ultraThinMaterial, in: Capsule())
}
}
}This approach ensures consistent behavior across devices while future-proofing your codebase.
When to watch for this issue
This behavior primarily affects developers using .glassEffect() on adjacent views, especially when:
- Two or more
.glassEffect()views are placed close together (e.g., inVStack,HStack, orZStack) - The
.interactive()modifier is applied for press/bounce feedback - No explicit shape is defined via the
in:parameter
The risk is compounded by the fact that the first button always works, masking the issue until user reports emerge. Testing every button—especially in edge cases like stacked layouts—is critical to catching this before release.
Key takeaways for iOS 26 developers
The Liquid Glass system in iOS 26 prioritizes visual cohesion, but its merging behavior can disrupt functionality if overlooked. Always specify a shape when using .glassEffect(.clear.interactive()) on adjacent views to prevent unintended gesture routing. While the fix is minimal, its impact on user experience is significant—ensuring every tap lands where intended.
For teams adopting Liquid Glass, thorough testing and a reusable modifier pattern will save time and frustration down the road. As iOS 26 rolls out, developers must balance innovation with practicality to deliver seamless interactions.
AI summary
iOS 26'deki Sıvı Cam efektini kullanırken karşılaşılan beklenmedik bir hata, komşu düğmelerin dokunuşlarını sessizce yutabilir. Bu sorunun nedenini ve basit çözümünü öğrenin.