Skip to content

Commit

Permalink
[#82] navigationbar appearance 도입
Browse files Browse the repository at this point in the history
  • Loading branch information
Gyuni committed Oct 1, 2021
1 parent 7999936 commit a070a7c
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions YDS/Source/Component/TopBar/YDSNavigationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand Down

0 comments on commit a070a7c

Please sign in to comment.