From a070a7ccdb4493c22167f6307e7104d0cf98532d Mon Sep 17 00:00:00 2001 From: Gyuni Date: Thu, 30 Sep 2021 14:49:01 +0900 Subject: [PATCH] =?UTF-8?q?[#82]=20navigationbar=20appearance=20=EB=8F=84?= =?UTF-8?q?=EC=9E=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TopBar/YDSNavigationController.swift | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/YDS/Source/Component/TopBar/YDSNavigationController.swift b/YDS/Source/Component/TopBar/YDSNavigationController.swift index 71bf6574..2eed8638 100644 --- a/YDS/Source/Component/TopBar/YDSNavigationController.swift +++ b/YDS/Source/Component/TopBar/YDSNavigationController.swift @@ -64,32 +64,28 @@ public class YDSNavigationController: UINavigationController { 각종 프로퍼티를 세팅합니다. */ private func setProperties() { - setNavigationBarBackIndicator() - setNavigationBarProperties() - } - - - /** - NavigationBar의 뒤로가기 아이콘 이미지를 설정합니다. - */ - private func setNavigationBarBackIndicator() { - let barAppearance = - UINavigationBar.appearance(whenContainedInInstancesOf: [YDSNavigationController.self]) - barAppearance.backIndicatorImage = YDSIcon.arrowLeftLine - barAppearance.backIndicatorTransitionMaskImage = YDSIcon.arrowLeftLine + setNavigationBarAppearance() } /** - NavigationBar의 프로퍼티를 설정합니다. + NavigationBar의 외관을 설정합니다. */ - private func setNavigationBarProperties() { - navigationBar.tintColor = YDSColor.buttonNormal - navigationBar.isTranslucent = false - navigationBar.shadowImage = UIImage() - navigationBar.titleTextAttributes = [ + private func setNavigationBarAppearance() { + let appearance = UINavigationBarAppearance() + appearance.configureWithOpaqueBackground() + appearance.backgroundColor = YDSColor.bgElevated + appearance.titleTextAttributes = [ NSAttributedString.Key.foregroundColor: YDSColor.textPrimary, NSAttributedString.Key.font: YDSFont.subtitle2, ] + appearance.setBackIndicatorImage(YDSIcon.arrowLeftLine, + transitionMaskImage: YDSIcon.arrowLeftLine) + appearance.shadowColor = nil + + navigationBar.tintColor = YDSColor.buttonNormal + navigationBar.standardAppearance = appearance + navigationBar.scrollEdgeAppearance = appearance + navigationBar.compactAppearance = appearance } /**