Kaynağa Gözat

Revert 'Refactor Tabbar modifications to be injected via Environment variable'

polscm32 aka Marvout 1 yıl önce
ebeveyn
işleme
bf20f81122

+ 0 - 10
FreeAPS/Sources/Application/AppState.swift

@@ -17,14 +17,4 @@ import UIKit
                 endPoint: .bottom
             )
     }
-
-    func configureTabBarAppearance() {
-        let appearance = UITabBarAppearance()
-        appearance.configureWithDefaultBackground()
-        appearance.backgroundEffect = UIBlurEffect(style: .systemChromeMaterial)
-        appearance.backgroundColor = UIColor.clear
-
-        UITabBar.appearance().standardAppearance = appearance
-        UITabBar.appearance().scrollEdgeAppearance = appearance
-    }
 }

+ 13 - 0
FreeAPS/Sources/Application/FreeAPSApp.swift

@@ -68,6 +68,9 @@ import Swinject
         // Load services
         loadServices()
 
+        // Fix bug in iOS 18 related to the translucent tab bar
+        configureTabBarAppearance()
+
         // Clear the persistentHistory and the NSManagedObjects that are older than 90 days every time the app starts
         cleanupOldData()
     }
@@ -95,6 +98,16 @@ import Swinject
         }
     }
 
+    func configureTabBarAppearance() {
+        let appearance = UITabBarAppearance()
+        appearance.configureWithDefaultBackground()
+        appearance.backgroundEffect = UIBlurEffect(style: .systemChromeMaterial)
+        appearance.backgroundColor = UIColor.clear
+
+        UITabBar.appearance().standardAppearance = appearance
+        UITabBar.appearance().scrollEdgeAppearance = appearance
+    }
+
     private func colorScheme(for colorScheme: ColorSchemeOption) -> ColorScheme? {
         switch colorScheme {
         case .systemDefault:

+ 0 - 1
FreeAPS/Sources/Modules/Home/View/HomeRootView.swift

@@ -847,7 +847,6 @@ extension Home {
                 configureView {
                     highlightButtons()
                 }
-                appState.configureTabBarAppearance()
             }
             .navigationTitle("Home")
             .navigationBarHidden(true)