From 0667023b589d9ef898bce3c0ae88bde3c8d5ada5 Mon Sep 17 00:00:00 2001 From: Anton Yarmolenko Date: Mon, 15 Jan 2024 18:11:42 +0100 Subject: [PATCH] chore: got rid unnecessary navigation background modifier --- Core/Core/Extensions/ViewExtension.swift | 9 --------- .../Presentation/Container/CourseContainerView.swift | 1 - Theme/Theme/Theme.swift | 6 ++---- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/Core/Core/Extensions/ViewExtension.swift b/Core/Core/Extensions/ViewExtension.swift index beb650ebe..f91e9c2ad 100644 --- a/Core/Core/Extensions/ViewExtension.swift +++ b/Core/Core/Extensions/ViewExtension.swift @@ -199,15 +199,6 @@ public extension View { } } } - - func navigationBackground(color: UIColor) -> some View { - return self.introspect( - .navigationView(style: .stack), - on: .iOS(.v15...), - scope: .ancestor) { - $0.navigationBar.barTintColor = color - } - } func hideScrollContentBackground() -> some View { if #available(iOS 16.0, *) { diff --git a/Course/Course/Presentation/Container/CourseContainerView.swift b/Course/Course/Presentation/Container/CourseContainerView.swift index 3903d4556..3e17216fd 100644 --- a/Course/Course/Presentation/Container/CourseContainerView.swift +++ b/Course/Course/Presentation/Container/CourseContainerView.swift @@ -84,7 +84,6 @@ public struct CourseContainerView: View { .navigationBarBackButtonHidden(false) .navigationTitle(titleBar()) .onChange(of: selection, perform: didSelect) - .navigationBackground(color: Theme.UIColors.background) .background(Theme.Colors.background) } diff --git a/Theme/Theme/Theme.swift b/Theme/Theme/Theme.swift index bbb98140e..fb75972e0 100644 --- a/Theme/Theme/Theme.swift +++ b/Theme/Theme/Theme.swift @@ -91,19 +91,17 @@ public struct Theme { } } + // Use this structure where the computed Color.uiColor() extension is not appropriate. public struct UIColors { public private(set) static var textPrimary = ThemeAssets.textPrimary.color public private(set) static var accentColor = ThemeAssets.accentColor.color - public private(set) static var background = ThemeAssets.background.color public static func update( textPrimary: UIColor = ThemeAssets.textPrimary.color, - accentColor: UIColor = ThemeAssets.accentColor.color, - background: UIColor = ThemeAssets.background.color + accentColor: UIColor = ThemeAssets.accentColor.color ) { self.textPrimary = textPrimary self.accentColor = accentColor - self.background = background } }