Skip to content

Commit b155c08

Browse files
authored
Refactor FXIOS-14251 move isRunningLiquidGlassEarlyBeta from DefaultB… (#31050)
1 parent 8a92056 commit b155c08

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

BrowserKit/Sources/Shared/DeviceInfo.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,24 @@ extension DeviceInfo {
3333
}
3434
}
3535

36+
/// Returns true for devices running iOS 26 Beta 1 to 3 (developer betas). These betas have an Apple bug with
37+
/// `UIGlassEffect`. See FXIOS-13528 for details. This workaround can probably be removed soon after iOS 26 official
38+
/// release and user adoption.
39+
public class var isRunningLiquidGlassEarlyBeta: Bool {
40+
let systemVersion = ProcessInfo.processInfo.operatingSystemVersionString
41+
42+
// Note: Info collected from https://betawiki.net/wiki/IOS_26. Beta 4 was the first public build.
43+
let betaBlockLists: [String] = [
44+
"23A257a", // Unconfirmed early release
45+
"23A5260n", // Developer Beta 1
46+
"23A5260u", // Developer Beta 1 Update for iPhone 15 and 16 series
47+
"23A5276f", // Developer Beta 2
48+
"23A5287g", // Developer Beta 3
49+
]
50+
51+
return betaBlockLists.contains { systemVersion.contains($0) }
52+
}
53+
3654
// Reports portrait screen size regardless of the current orientation.
3755
@MainActor
3856
public class func screenSizeOrientationIndependent() -> CGSize {

firefox-ios/Client/Application/DefaultBrowserUtility.swift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -95,24 +95,6 @@ class DefaultBrowserUtility {
9595
return betaBlockLists.contains { systemVersion.contains($0) }
9696
}
9797

98-
/// Returns true for devices running iOS 26 Beta 1 to 3 (developer betas). These betas have an Apple bug with
99-
/// `UIGlassEffect`. See FXIOS-13528 for details. This workaround can probably be removed soon after iOS 26 official
100-
/// release and user adoption.
101-
static var isRunningLiquidGlassEarlyBeta: Bool {
102-
let systemVersion = ProcessInfo.processInfo.operatingSystemVersionString
103-
104-
// Note: Info collected from https://betawiki.net/wiki/IOS_26. Beta 4 was the first public build.
105-
let betaBlockLists: [String] = [
106-
"23A257a", // Unconfirmed early release
107-
"23A5260n", // Developer Beta 1
108-
"23A5260u", // Developer Beta 1 Update for iPhone 15 and 16 series
109-
"23A5276f", // Developer Beta 2
110-
"23A5287g", // Developer Beta 3
111-
]
112-
113-
return betaBlockLists.contains { systemVersion.contains($0) }
114-
}
115-
11698
private func trackIfUserIsDefault(_ isDefault: Bool) {
11799
userDefault.set(isDefault, forKey: PrefsKeys.AppleConfirmedUserIsDefaultBrowser)
118100

firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class BrowserViewController: UIViewController,
212212

213213
private lazy var effect: some UIVisualEffect = {
214214
#if canImport(FoundationModels)
215-
if #available(iOS 26, *), !DefaultBrowserUtility.isRunningLiquidGlassEarlyBeta {
215+
if #available(iOS 26, *), !DeviceInfo.isRunningLiquidGlassEarlyBeta {
216216
return UIGlassEffect(style: .regular)
217217
} else {
218218
return UIBlurEffect(style: .systemUltraThinMaterial)

firefox-ios/Client/Frontend/Browser/Tabs/Views/CustomSelectorView/TabTraySelectorView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class TabTraySelectorView: UIView,
5959

6060
private lazy var visualEffectView: UIVisualEffectView = .build { view in
6161
#if canImport(FoundationModels)
62-
if #available(iOS 26, *), !DefaultBrowserUtility.isRunningLiquidGlassEarlyBeta {
62+
if #available(iOS 26, *), !DeviceInfo.isRunningLiquidGlassEarlyBeta {
6363
view.effect = UIGlassEffect(style: .regular)
6464
} else {
6565
view.effect = UIBlurEffect(style: .systemUltraThinMaterial)

0 commit comments

Comments
 (0)