gitmyhub

LiquidGlassFlag

Swift ★ 25 updated 24d ago

Demonstrates how to dynamically enable Liquid Glass in an iOS app at runtime

A Swift sample project showing iOS developers how to toggle Apple's Liquid Glass visual style on or off at app launch using a user defaults flag, without shipping two separate builds.

SwiftXcodeiOSsetup: easycomplexity 2/5

LiquidGlassFlag is a small Swift sample project for iOS developers who want to understand how to turn Apple's Liquid Glass visual style on or off inside a running app without shipping two separate builds. Liquid Glass is a design style introduced with iOS 26 that gives app interfaces a translucent, glass-like appearance.

The technique shown here uses a user defaults flag, which is a standard iOS mechanism for storing simple on/off settings on a device. By setting a specific internal flag in user defaults, the app can opt back into Liquid Glass even when the app's Info.plist file has it disabled by default. The project also shows how to make that decision randomly on first launch, which is the approach a team would use for a phased rollout where only some users get the new look.

One important detail the README calls out: the flag is only read once, early in the app's startup process. That means toggling it while the app is running has no visible effect until the user quits and reopens the app. If you want the decision to take effect from the very first screen the user sees, the flag needs to be written before the app's main entry point starts up.

The author notes this is a demonstration rather than a pattern they would recommend for production use. It is more of an explanation of how apps like WhatsApp were able to do staged rollouts of Liquid Glass for different groups of users.

The repository contains a single working Xcode project built against the iOS 26 SDK. It is aimed at developers already familiar with iOS app development who want a concrete, runnable example of this specific technique.

Where it fits