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 [#5] 커스텀 네비게이션바 제작 #11

Merged
merged 9 commits into from
May 5, 2024

Conversation

Zoe0929
Copy link
Member

@Zoe0929 Zoe0929 commented Apr 6, 2024

👾 작업 내용

커스텀 네비게이션 바를 제작했습니다.

🚀 PR Point

ViewModifier를 이용하여 CustomNavigationBar를 재사용했습니다.
네비게이션 바를 적용할 때 아래와 같이 추가해주세요.

struct HomeView: View {
    var body: some View {
        Text("Home")
            .foregroundColor(.white)
            .padding()
            .frame(maxWidth: .infinity, maxHeight: .infinity) 
            .background(Color.red)
            .customNavigationBar(title: "내 이용시간",
                                 showBackButton: false,
                                 showPointButton: false) // 네비게이션 바 추가
    }
}

📸 스크린샷

구현 내용 스크린샷
네비게이션 바 구현 image

✅ CheckList

  • 오류 없이 빌드되는지 확인
  • 로그용 print문 제거
  • 불필요한 주석 제거
  • 코드 컨벤션 확인

🔗 Issue

Resolved #5

@Zoe0929 Zoe0929 linked an issue Apr 6, 2024 that may be closed by this pull request
@Zoe0929 Zoe0929 requested a review from kim-seonwoo April 6, 2024 18:13
@Zoe0929 Zoe0929 self-assigned this Apr 6, 2024
@Zoe0929 Zoe0929 added 🐰지희 지희의 issue 🎨STYLE 커스텀 뷰 짜기 labels Apr 6, 2024
Copy link
Member

@kim-seonwoo kim-seonwoo left a comment

Choose a reason for hiding this comment

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

👍 사실 Custom Modifier의 구현을 처음 봐서 너무 신기합니다! 수고 많으셨습니당~

Comment on lines +22 to +35
if showBackButton {
Button(action: {
dismiss()
}) {
Image(.chevronLeft)
.resizable()
.scaledToFit()
.frame(width: 20,height: 20)
}
.padding(EdgeInsets(top: 0, leading: 14, bottom: 0, trailing: 8))
} else {
Image(.chevronLeft).hidden()
.padding(EdgeInsets(top: 0, leading: 14, bottom: 0, trailing: 0))
}
Copy link
Member

Choose a reason for hiding this comment

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

💊 버튼과 같은 요소들을 따로 private func OnboardingTitleView() -> some View {}
와 같이 하위에 빼주고 body를 간결하게 해보는 것, 좋을 수 있을 것 같기도합니다

Copy link
Member Author

Choose a reason for hiding this comment

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

c19cf89 여기서 반영했습니다!
이 부분은 뷰 모델로 빼는 게 맞는 것 같은데, 조금 고민되는 부분이 있어서 추후에 리팩토링하며 코드 개선해보겠습니다

@Zoe0929 Zoe0929 added this to the 🔭2차 스프린트🪐 milestone Apr 11, 2024
@Zoe0929 Zoe0929 force-pushed the feat/#5-NavigationBar branch from c53628a to 3473ff4 Compare May 5, 2024 17:06
@Zoe0929 Zoe0929 merged commit da8e58a into develop May 5, 2024
@Zoe0929 Zoe0929 deleted the feat/#5-NavigationBar branch June 19, 2024 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎨STYLE 커스텀 뷰 짜기 🐰지희 지희의 issue
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feat] NavigationView 추가
2 participants