.glassEffect(_in:) crushing on iOS 26 public beta.

In one of my apps, i am using .glassEffect(_:In) to add glass effect on various elements. The app always crushes when a UI element with glassEffect(_in:) modifier is being rendered. This only happens on device running iOS 26 public beta. I know this for certain because I connected the particular device to xcode and run the app on the device. When i comment out the glassEffect modifier, app doesn't crush.

Is it possible to check particular realeases with #available? If not, how should something like this be handled. Also how do i handle such os level erros without the app crushing. Thanks.

Do you mean 'crashing'?

Which version is 'iOS public beta'? Is it iOS 26.2 beta? Or is this the public beta before iOS 26 was first released in September?

What code are you using, and what is the crash? You say you're using .glassEffect(_in:) but you don't give any actual values.

Yeah, it will be a really big surprise if using .glassEffect(_:in:) triggers a crash in the latest iOS. So as @darkpaw said, providing more details about your issue will help clarify.

Regarding #available, you can definitely use it to check the OS version. The following code behaves differently on iOS 26.1 and later:

if #available(iOS 26.1, *) {
	print("iOS 26.1 and later")
} else {
	print("Before iOS 26.1")
}

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

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.

You added a comment to my post saying:

The device is running the public beta before iOS 26 was officially released in september

You shouldn't be running the public beta from before iOS 26 was released. That version is out of date.

Does your code work on the currently-released version of iOS, which is 26.1?

.glassEffect(_in:) crushing on iOS 26 public beta.
 
 
Q