diff --git a/Riot/Managers/Theme/Theme.swift b/Riot/Managers/Theme/Theme.swift index f8e0a382d..93d9cb2a9 100644 --- a/Riot/Managers/Theme/Theme.swift +++ b/Riot/Managers/Theme/Theme.swift @@ -112,7 +112,7 @@ import DesignKit /// - Parameter tabBar: The tab bar to customise. func applyStyle(onTabBar tabBar: UITabBar) - /// Apply the theme on a navigation bar, without enabling the iOS 15's scroll edges appearance. + /// Apply the theme on a navigation bar, without enabling the iOS 15's scroll edge appearance. /// /// - Parameter navigationBar: the navigation bar to customise. func applyStyle(onNavigationBar navigationBar: UINavigationBar) @@ -120,9 +120,9 @@ import DesignKit /// Apply the theme on a navigation bar. /// /// - Parameter navigationBar: the navigation bar to customise. - /// - Parameter modernScrollEdgesAppearance: whether or not to use the iOS 15 style scroll edges appearance + /// - Parameter modernScrollEdgeAppearance: whether or not to use the iOS 15 style scroll edge appearance func applyStyle(onNavigationBar navigationBar: UINavigationBar, - withModernScrollEdgesAppearance modernScrollEdgesAppearance: Bool) + withModernScrollEdgeAppearance modernScrollEdgeAppearance: Bool) /// Apply the theme on a search bar. /// diff --git a/Riot/Managers/Theme/Themes/DarkTheme.swift b/Riot/Managers/Theme/Themes/DarkTheme.swift index ae19db7e7..d61ed3954 100644 --- a/Riot/Managers/Theme/Themes/DarkTheme.swift +++ b/Riot/Managers/Theme/Themes/DarkTheme.swift @@ -114,11 +114,11 @@ class DarkTheme: NSObject, Theme { // Protocols don't support default parameter values and a protocol extension won't work for @objc func applyStyle(onNavigationBar navigationBar: UINavigationBar) { - applyStyle(onNavigationBar: navigationBar, withModernScrollEdgesAppearance: false) + applyStyle(onNavigationBar: navigationBar, withModernScrollEdgeAppearance: false) } func applyStyle(onNavigationBar navigationBar: UINavigationBar, - withModernScrollEdgesAppearance modernScrollEdgesAppearance: Bool) { + withModernScrollEdgeAppearance modernScrollEdgeAppearance: Bool) { navigationBar.tintColor = tintColor // On iOS 15 use UINavigationBarAppearance to fix visual issues with the scrollEdgeAppearance style. @@ -127,7 +127,7 @@ class DarkTheme: NSObject, Theme { appearance.configureWithOpaqueBackground() appearance.backgroundColor = baseColor - if !modernScrollEdgesAppearance { + if !modernScrollEdgeAppearance { appearance.shadowColor = nil } appearance.titleTextAttributes = [ @@ -135,7 +135,7 @@ class DarkTheme: NSObject, Theme { ] navigationBar.standardAppearance = appearance - navigationBar.scrollEdgeAppearance = modernScrollEdgesAppearance ? nil : appearance + navigationBar.scrollEdgeAppearance = modernScrollEdgeAppearance ? nil : appearance } else { navigationBar.titleTextAttributes = [ NSAttributedString.Key.foregroundColor: textPrimaryColor diff --git a/Riot/Managers/Theme/Themes/DefaultTheme.swift b/Riot/Managers/Theme/Themes/DefaultTheme.swift index a7832ba07..e2afd9339 100644 --- a/Riot/Managers/Theme/Themes/DefaultTheme.swift +++ b/Riot/Managers/Theme/Themes/DefaultTheme.swift @@ -120,11 +120,11 @@ class DefaultTheme: NSObject, Theme { // Protocols don't support default parameter values and a protocol extension doesn't work for @objc func applyStyle(onNavigationBar navigationBar: UINavigationBar) { - applyStyle(onNavigationBar: navigationBar, withModernScrollEdgesAppearance: false) + applyStyle(onNavigationBar: navigationBar, withModernScrollEdgeAppearance: false) } func applyStyle(onNavigationBar navigationBar: UINavigationBar, - withModernScrollEdgesAppearance modernScrollEdgesAppearance: Bool) { + withModernScrollEdgeAppearance modernScrollEdgeAppearance: Bool) { navigationBar.tintColor = tintColor // On iOS 15 use UINavigationBarAppearance to fix visual issues with the scrollEdgeAppearance style. @@ -133,7 +133,7 @@ class DefaultTheme: NSObject, Theme { appearance.configureWithOpaqueBackground() appearance.backgroundColor = baseColor - if !modernScrollEdgesAppearance { + if !modernScrollEdgeAppearance { appearance.shadowColor = nil } appearance.titleTextAttributes = [ @@ -141,7 +141,7 @@ class DefaultTheme: NSObject, Theme { ] navigationBar.standardAppearance = appearance - navigationBar.scrollEdgeAppearance = modernScrollEdgesAppearance ? nil : appearance + navigationBar.scrollEdgeAppearance = modernScrollEdgeAppearance ? nil : appearance } else { navigationBar.titleTextAttributes = [ NSAttributedString.Key.foregroundColor: textPrimaryColor diff --git a/Riot/Modules/Authentication/AuthenticationViewController.m b/Riot/Modules/Authentication/AuthenticationViewController.m index 448d75b8b..c8507dc5e 100644 --- a/Riot/Modules/Authentication/AuthenticationViewController.m +++ b/Riot/Modules/Authentication/AuthenticationViewController.m @@ -211,7 +211,7 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0; - (void)userInterfaceThemeDidChange { [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar - withModernScrollEdgesAppearance:YES]; + withModernScrollEdgeAppearance:YES]; self.view.backgroundColor = ThemeService.shared.theme.backgroundColor; diff --git a/Riot/Modules/Common/SwiftUI/VectorHostingController.swift b/Riot/Modules/Common/SwiftUI/VectorHostingController.swift index 6e5699e94..c79762b89 100644 --- a/Riot/Modules/Common/SwiftUI/VectorHostingController.swift +++ b/Riot/Modules/Common/SwiftUI/VectorHostingController.swift @@ -32,7 +32,7 @@ class VectorHostingController: UIHostingController { // MARK: Public - var enableNavigationBarScrollEdgesAppearance = false + var enableNavigationBarScrollEdgeAppearance = false init(rootView: Content) where Content: View { self.theme = ThemeService.shared().theme @@ -93,7 +93,7 @@ class VectorHostingController: UIHostingController { private func update(theme: Theme) { if let navigationBar = self.navigationController?.navigationBar { - theme.applyStyle(onNavigationBar: navigationBar, withModernScrollEdgesAppearance: enableNavigationBarScrollEdgesAppearance) + theme.applyStyle(onNavigationBar: navigationBar, withModernScrollEdgeAppearance: enableNavigationBarScrollEdgeAppearance) } } } diff --git a/RiotSwiftUI/Modules/Onboarding/UseCase/Coordinator/OnboardingUseCaseSelectionCoordinator.swift b/RiotSwiftUI/Modules/Onboarding/UseCase/Coordinator/OnboardingUseCaseSelectionCoordinator.swift index 0a2d7eae4..e6473eeb4 100644 --- a/RiotSwiftUI/Modules/Onboarding/UseCase/Coordinator/OnboardingUseCaseSelectionCoordinator.swift +++ b/RiotSwiftUI/Modules/Onboarding/UseCase/Coordinator/OnboardingUseCaseSelectionCoordinator.swift @@ -41,7 +41,7 @@ final class OnboardingUseCaseSelectionCoordinator: Coordinator, Presentable { let hostingController = VectorHostingController(rootView: view) hostingController.vc_removeBackTitle() - hostingController.enableNavigationBarScrollEdgesAppearance = true + hostingController.enableNavigationBarScrollEdgeAppearance = true onboardingUseCaseHostingController = hostingController } diff --git a/RiotSwiftUI/Modules/Spaces/SpaceSettings/SpaceSettings/Coordinator/SpaceSettingsCoordinator.swift b/RiotSwiftUI/Modules/Spaces/SpaceSettings/SpaceSettings/Coordinator/SpaceSettingsCoordinator.swift index 0199bb8a5..d0f4c6790 100644 --- a/RiotSwiftUI/Modules/Spaces/SpaceSettings/SpaceSettings/Coordinator/SpaceSettingsCoordinator.swift +++ b/RiotSwiftUI/Modules/Spaces/SpaceSettings/SpaceSettings/Coordinator/SpaceSettingsCoordinator.swift @@ -53,7 +53,7 @@ final class SpaceSettingsCoordinator: Coordinator, Presentable { .addDependency(AvatarService.instantiate(mediaManager: parameters.session.mediaManager)) spaceSettingsViewModel = viewModel let controller = VectorHostingController(rootView: view) - controller.enableNavigationBarScrollEdgesAppearance = true + controller.enableNavigationBarScrollEdgeAppearance = true spaceSettingsHostingController = controller } diff --git a/changelog.d/pr-5826.api b/changelog.d/pr-5826.api new file mode 100644 index 000000000..e4847b927 --- /dev/null +++ b/changelog.d/pr-5826.api @@ -0,0 +1 @@ + Rename scrollEdgesAppearance → scrollEdgeAppearance to match UIKit. \ No newline at end of file