-
Notifications
You must be signed in to change notification settings - Fork 2
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
[refactor] 네비게이션 바 경계선 구현 방식 변경 #307
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
편의생성자를 도입할 생각은 못했었는데 아주 좋은방법이네요!
(편의생성자를 직접 도입한적이 없어서 이전에 공부햇던거 참고하고옴,,)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨어요. 남겨주신 내용 확인했고 다음 PR 때 같이 반영해서 올리겠습니다.
private func addBorder() { | ||
let border = Self.borderLine | ||
|
||
if !navigationBar.subviews.contains(where: { $0 == border }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이걸 이렇게 구현 할 수 있군요 ... 진짜 대단합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convenience init
의 사용까지 잘 보고 갑니다 멋진 코드군요 👍
import Then | ||
|
||
extension UINavigationController { | ||
fileprivate static let borderLine = UIView(backgroundColor: .gray2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
접근제어자를 fileprivate
으로 설정한 까닭이 있으실까요? 개념으로만 접하다가 실제로 사용되는 경우를 보니 잘 와닿지 않아서 질문드립니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
외부에서 공용 인스턴스인 borderLine에 마음대로 접근하는 것을 막기 위함입니다.
🔗 연결된 이슈
📄 작업 내용
💻 주요 코드 설명
경계선 표현을 위한 단일 인스턴스
UINavigationController+.swift
UINavigationController의 편의생성자
UINavigationController+.swift
실제 사용하기 위한 BaseViewController 수정
true
를 할당하면 되겠습니다.BaseViewController.swift
👀 기타 더 이야기해볼 점