Backport of Apple’s Liquid Glass system for iOS 13–18 with native API parity. Includes a reimplementation for iOS 26+ that unlocks advanced customization beyond the native system's limits.
Swift
459
6 commits
updated Jan 9, 2026
A backport of Apple's Liquid Glass design system for iOS 13 through 18, featuring native API compatibility for seamless in-place substitution and convenient factory methods that allow you to choose between native and recreated components on iOS 26+.
LiquidGlassKit brings the beautiful liquid glass visual effects from iOS 26 to older iOS versions. The library provides drop-in replacements for native components with full API compatibility, ensuring your code works seamlessly across iOS versions while automatically leveraging native implementations when available.
The core rendering engine that produces the liquid glass effect using Metal shaders. It captures background content behind the view and applies sophisticated glass-like visual effects including:
The view utilizes CABackdropLayer and a zero-copy bridge to efficiently capture and process background content.
[!WARNING] The LiquidGlassKit also includes an App Store-safe alternative background capture method that relies solely on public APIs. This approach uses root view rendering instead of the private CABackdropLayer, making it more CPU-intensive while preserving the full liquid glass effect. Starting with iOS 26.2, this is the only working method and is used automatically.
A custom implementation of the private _UILiquidLensView used in iOS 26's UITabBar. This component provides:
LiquidGlassView when the tab bar item is lifted[!NOTE] The view implements the
AnyLiquidLensViewprotocol, enabling it to serve as a drop-in replacement for the private_UILiquidLensViewclass.
A UIVisualEffectView-compatible wrapper that provides liquid glass effects through the standard visual effect API. Supports:
[!NOTE] LiquidGlassKit declares the
AnyVisualEffectViewprotocol, which both nativeUIVisualEffectViewand the customLiquidGlassEffectViewconform to, enabling seamless interoperability between implementations.
A fully compatible UISlider replacement that replicates iOS 26's liquid glass sliding style. Features include:
[!NOTE] LiquidGlassKit declares the
AnySliderprotocol, which both nativeUISliderand the customLiquidGlassSliderconform to, ensuring full API compatibility across implementations.
A UISwitch replacement that replicates iOS 26's liquid glass sliding style. Features include:
[!NOTE] LiquidGlassKit declares the
AnySwitchprotocol, which both nativeUISwitchand the customLiquidGlassSwitchconform to, ensuring full API compatibility across implementations.
A utility class that bridges rendering into Metal textures using zero-copy techniques via IOSurface. By avoiding unnecessary memory copies, it further improves performance and helps maintain high frame rates throughout the liquid glass rendering pipeline.
All components provide factory methods that automatically select the appropriate implementation:
// Automatically uses native UISwitch on iOS 26+, custom on older versions
let switch = LiquidGlassSwitch.make(isNative: true)
// Automatically uses native UISlider on iOS 26+, custom on older versions
let slider = LiquidGlassSlider.make(isNative: true)
// Automatically uses native UIVisualEffectView on iOS 26+, custom on older versions
let effectView = VisualEffectView(effect: LiquidGlassEffect(style: .regular, isNative: true))
Example usage with private view and open alternative:
var liquidLensView: UILiquidLensView?
if #available(iOS 26.0, *) {
let viewClass: AnyClass? = NSClassFromString("_UILiquidLensView")
class_addProtocol(viewClass, AnyLiquidLensView.self)
liquidLensView = (viewClass as? AnyLiquidLensView.Type)?.init() as? UILiquidLensView
} else {
liquidLensView = LiquidLensView()
}
Add LiquidGlassKit to your Package.swift:
dependencies: [
.package(url: "https://github.com/yourusername/LiquidGlassKit.git", from: "1.0.0")
]
Or add it through Xcode:
A BUILD file is provided for Bazel users, containing build rules for both the library and Metal shader resources.
[!IMPORTANT] Bookmark this project to stay updated with the latest developments. Contributions are welcome! Whether it's bug fixes, feature enhancements, or documentation improvements, your help makes this project better for everyone.
Copyright © 2025 DnV1eX
4,650 followers · starred Jan 2026
373 followers · starred May 2026
1,502 followers · starred Feb 2026
97 followers · starred Jan 2026
Backport of Apple’s Liquid Glass system for iOS 13–18 with native API parity. Includes a reimplementation for iOS 26+ that unlocks advanced customization beyond the native system's limits.
Swift
459
6 commits
updated Jan 9, 2026
A backport of Apple's Liquid Glass design system for iOS 13 through 18, featuring native API compatibility for seamless in-place substitution and convenient factory methods that allow you to choose between native and recreated components on iOS 26+.
LiquidGlassKit brings the beautiful liquid glass visual effects from iOS 26 to older iOS versions. The library provides drop-in replacements for native components with full API compatibility, ensuring your code works seamlessly across iOS versions while automatically leveraging native implementations when available.
The core rendering engine that produces the liquid glass effect using Metal shaders. It captures background content behind the view and applies sophisticated glass-like visual effects including:
The view utilizes CABackdropLayer and a zero-copy bridge to efficiently capture and process background content.
[!WARNING] The LiquidGlassKit also includes an App Store-safe alternative background capture method that relies solely on public APIs. This approach uses root view rendering instead of the private CABackdropLayer, making it more CPU-intensive while preserving the full liquid glass effect. Starting with iOS 26.2, this is the only working method and is used automatically.
A custom implementation of the private _UILiquidLensView used in iOS 26's UITabBar. This component provides:
LiquidGlassView when the tab bar item is lifted[!NOTE] The view implements the
AnyLiquidLensViewprotocol, enabling it to serve as a drop-in replacement for the private_UILiquidLensViewclass.
A UIVisualEffectView-compatible wrapper that provides liquid glass effects through the standard visual effect API. Supports:
[!NOTE] LiquidGlassKit declares the
AnyVisualEffectViewprotocol, which both nativeUIVisualEffectViewand the customLiquidGlassEffectViewconform to, enabling seamless interoperability between implementations.
A fully compatible UISlider replacement that replicates iOS 26's liquid glass sliding style. Features include:
[!NOTE] LiquidGlassKit declares the
AnySliderprotocol, which both nativeUISliderand the customLiquidGlassSliderconform to, ensuring full API compatibility across implementations.
A UISwitch replacement that replicates iOS 26's liquid glass sliding style. Features include:
[!NOTE] LiquidGlassKit declares the
AnySwitchprotocol, which both nativeUISwitchand the customLiquidGlassSwitchconform to, ensuring full API compatibility across implementations.
A utility class that bridges rendering into Metal textures using zero-copy techniques via IOSurface. By avoiding unnecessary memory copies, it further improves performance and helps maintain high frame rates throughout the liquid glass rendering pipeline.
All components provide factory methods that automatically select the appropriate implementation:
// Automatically uses native UISwitch on iOS 26+, custom on older versions
let switch = LiquidGlassSwitch.make(isNative: true)
// Automatically uses native UISlider on iOS 26+, custom on older versions
let slider = LiquidGlassSlider.make(isNative: true)
// Automatically uses native UIVisualEffectView on iOS 26+, custom on older versions
let effectView = VisualEffectView(effect: LiquidGlassEffect(style: .regular, isNative: true))
Example usage with private view and open alternative:
var liquidLensView: UILiquidLensView?
if #available(iOS 26.0, *) {
let viewClass: AnyClass? = NSClassFromString("_UILiquidLensView")
class_addProtocol(viewClass, AnyLiquidLensView.self)
liquidLensView = (viewClass as? AnyLiquidLensView.Type)?.init() as? UILiquidLensView
} else {
liquidLensView = LiquidLensView()
}
Add LiquidGlassKit to your Package.swift:
dependencies: [
.package(url: "https://github.com/yourusername/LiquidGlassKit.git", from: "1.0.0")
]
Or add it through Xcode:
A BUILD file is provided for Bazel users, containing build rules for both the library and Metal shader resources.
[!IMPORTANT] Bookmark this project to stay updated with the latest developments. Contributions are welcome! Whether it's bug fixes, feature enhancements, or documentation improvements, your help makes this project better for everyone.
Copyright © 2025 DnV1eX
4,650 followers · starred Jan 2026
373 followers · starred May 2026
1,502 followers · starred Feb 2026
97 followers · starred Jan 2026