Post

Replies

Boosts

Views

Activity

Reply to .glassEffect(_in:) crushing on iOS 26 public beta.
I am using a view modifier like this: struct GlassEffectViewModifier: ViewModifier { var shape: any InsettableShape = .capsule var fallBack: Material = .thin func body(content: Content) -> some View { if #available(iOS 26.0, *) { content .glassEffect(.regular, in: shape) } else { content .background(fallBack, in: .capsule) } } } extension View { public func withGlassEffect( in shape: some InsettableShape = .capsule, fallback: Material = .thin ) -> some View { modifier( GlassEffectWithShapeViewModifier(shape: shape, fallBack: fallback) ) } } It always crashes on the .glassEffect(.regular, in: shape) line. If i comment it out or use a different modifier, it doesn't crash.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’25
Reply to .glassEffect(_in:) crushing on iOS 26 public beta.
Thanks for the detailed feedback. I get it that it's not practical to target pre-release betas. With #available checks, i use that, i even have this package which has various backwards compatible modifiers for new APIs. It follows same concept as your Additional struct. My question on how to handle crashes is not limited to just iOS version variations issues. I was refering to general exceptions and runtime errors that can cause app termination. Thanks.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’25