Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat [#7] 커스텀 HMHNavigationBar 구현 #8

Merged
merged 7 commits into from
Jan 2, 2024

Conversation

kim-seonwoo
Copy link
Member

👾 작업 내용

  • HMHNavigationBar 파일에 프로젝트 전반에 사용되는 네비게이션 바를 구현하였습니다.
  • ImageLiterals 파일을 생성하였습니다.
  • 아직 아이콘의 일부는 추가하지 못했습니다. 파란 배경으로 대체하였습니다.

🚀 PR Point

네비게이션바 타입 종류

HMHNavigationBar의 NavigationBarType은 HMH 로고 이미지를 포함하는 네비게이션 바를 표현 한 logo type과
그 외의 일반적인 네비게이션 바 상황을 담은 normal로 case 분류를 하였습니다.

    enum NavigationBarType {
        case normal
        case logo
    }

네비게이션바 사용법

다음은 네비게이션 바 사용예시입니다.

lazy var navigationBar = HMHNavigationBar(self, leftItem: .normal, isBackButton: true, isTitleLabel: true, isPointImage: true, titleText: "마이페이지")
  • 첫 파라미터는 self로 설정하여 해당 viewController를 나타내 줍니다.
  • leftItem에 normal과 logo 중 설정해 줍니다.
  • isBackButton, isTitleLabel, isPointImage에 Bool값을 설정합니다. false로 설정 시 해당 요소가 생략된 네비게이션 바가 생성됩니다.
  • titleText에 중앙 라벨에 보여질 텍스트의 내용을 입력합니다.

ImageLiteral 설정&사용

  • 다음과 같이 Image.swift에 쓰일 이미지를 작성합니다.
enum ImageLiterals {
    enum NavigationBar {
        static var icArrowLeft: UIImage { .load(named: "ic_back")}
    }
}
  • 다음은 ImageLiterals 사용 예시입니다.
$0.setImage(ImageLiterals.NavigationBar.icArrowLeft, for: .normal)

📸 스크린샷

구현 내용 스크린샷
HMHNavigationBar 사용 예시

✅ Issue

Resolved #7

@kim-seonwoo kim-seonwoo added 😎선우 선우의 issue 🌈 feat 기능 구현 🎨 style 커스텀 뷰 짜기 labels Jan 2, 2024
@kim-seonwoo kim-seonwoo added this to the 🚀1차 스프린트🚀 milestone Jan 2, 2024
@kim-seonwoo kim-seonwoo self-assigned this Jan 2, 2024
@kim-seonwoo kim-seonwoo linked an issue Jan 2, 2024 that may be closed by this pull request
Copy link
Contributor

@boyeon0119 boyeon0119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

너무 빠릅니다. 속도 맞춰주세요~ 🙏🫢👍

Copy link
Member

@Zoe0929 Zoe0929 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2. 왕빠르다 ! 고생하셨습니다. 🚀🐹

@kim-seonwoo kim-seonwoo merged commit f54c8a4 into develop Jan 2, 2024
@kim-seonwoo kim-seonwoo deleted the feat/#7-NavigationBar branch January 9, 2024 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌈 feat 기능 구현 🎨 style 커스텀 뷰 짜기 😎선우 선우의 issue
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feat] 커스텀 네비게이션 바 구현
3 participants