explaingit

insidegui/liquidglassflag

21SwiftAudience · developerComplexity · 2/5Setup · easy

TLDR

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.

Mindmap

mindmap
  root((liquidglassflag))
    What it does
      Toggle Liquid Glass on or off
      Single build dual behavior
      Phased rollout demo
    How it works
      User defaults flag
      Read once at launch
      Written before main entry
    Use Cases
      Random first-launch rollout
      Beta tester override
      Staged user rollout
    Constraints
      iOS 26 SDK required
      Flag read once only
      Restart needed to apply
    Platform
      Swift Xcode iOS 26
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Implement a phased rollout of iOS 26 Liquid Glass where only a chosen percentage of users see the new visual style on first launch.

USE CASE 2

Add a hidden override flag so beta testers can opt into Liquid Glass even when your app has it disabled by default.

USE CASE 3

Learn the exact code placement required to write a launch-time flag before the iOS app's main entry point runs.

Tech stack

SwiftXcodeiOS

Getting it running

Difficulty · easy Time to first run · 5min

Requires Xcode with the iOS 26 SDK, will not compile against earlier iOS SDK versions.

In plain English

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.

Copy-paste prompts

Prompt 1
Show me how to add the Liquid Glass feature flag from liquidglassflag to my iOS app and make it activate randomly for 20% of users on their first launch.
Prompt 2
I need TestFlight users to be able to opt into Liquid Glass via a hidden Settings bundle toggle while all other users stay on the old UI. Adapt the liquidglassflag technique to read from a settings bundle key.
Prompt 3
Walk me through why the Liquid Glass flag in liquidglassflag must be written before the app main entry point, and show me the exact Swift code and file location where this has to happen.
Open on GitHub → Explain another repo

← insidegui on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.