-
Notifications
You must be signed in to change notification settings - Fork 0
[feat] 사이드 바 UI 구현 #141
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] 사이드 바 UI 구현 #141
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.
사이드뷰도 많이 복잡했네요 ㅜㅜ 고생하셨습니다 👍🏻
혹시 ContainerVC 네이밍을 좀 더 명시적으로 바꾸는 건 어떨까요 ?!
RootContainerVC라던지 ,, 등등 의견있으면 주십쇼 !!ㅎㅎ
네이밍 관련한 부분들 여기서 해결하고 넘어가는 게 좋을 것 같아서 일단 r-c요청 해놓겠습니다 :)
UIView.animate( | ||
withDuration: 0.5, | ||
delay: 0, | ||
usingSpringWithDamping: 1.0, | ||
initialSpringVelocity: 0, | ||
options: .layoutSubviews, | ||
animations: { |
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.
q; 현재 뷰가 애니메이션이 적용된 상황인가요 ?!
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.
아니요. 적용이 안됐습니다 😭
이 부분은 좀더 고민해보겠습니다!
}) | ||
} | ||
|
||
private func closeSideMenu(_ completion: (() -> Void)?) { |
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.
p2; 여기 completion이 하는 역할이 뭔가요 ?
nil만 넘겨주고 있는 것 같은데 추후에 다른 클로저가 넘어올 일이 있나요 ?!
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.
앗 아뇨. 나중에 지운다는걸 그냥 넘긴것 같습니다. 👍
addChild(navigationVC) | ||
view.addSubview(navigationVC.view) | ||
navigationVC.didMove(toParent: self) | ||
self.navigationVC = navigationVC |
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.
이게 컨테이너 뷰컨트롤러를 통해서 사이드바 뷰컨트롤러랑 메인 뷰 컨트롤러를 화면에 동시에 띄워주려면
사이드바와 메인 뷰 둘다 부모-자식 뷰컨 관계가 되어야한다고 알고있어서 그 관계를 설정해주는 부분입니다.
근데 여기에 자식 뷰컨의 뷰도 같이 addSubView로 넣어줘야 하더라구요.
@@ -43,5 +43,6 @@ enum TLImage { | |||
|
|||
enum Home { | |||
static let close = TravelineAsset.Images.closeMedium.image | |||
static let menu = TravelineAsset.Images.menu.image |
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.
우악. Home 지워뒀는데 ㅎㅎ 죄송 . . 먼저 머지하시면 제가 해결하겠습니다 ~
return view | ||
}() | ||
|
||
private let profileLabel: ProfileLabel = .init() |
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.
p2; 버튼인데 Label이란 네이밍이 좀 어색해서 혹시 myPostListButton으로 하는 건 어떨까요 ?
나머지 Label들도 마찬가지일 것 같아요 !
if view === menuView { | ||
return false | ||
} | ||
return true | ||
} |
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.
오호 .. 저는 터치에 걸린 뷰가 menuView가 맞는지 확인할 때, 참조하고 있는 뷰가 같은지 확인하려고 ===을 써줬었습니다!
근데 == 로 비교해도 잘되네요 ㅎㅎ
func setupAttributes() { | ||
} |
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.
p3; 여기서 쓸 일 없으면 지워도 될 것 같습니다 :)
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.
고생하셨습니다 기웅님~!~! 🥺
Container 활용하는건 안해봤었는데 신기하네용,,,,
궁금한 점들 코멘트 남겨두었습니닷닷
self.sideMenuVC.view.insertSubview(shadowView, at: 0) | ||
self.sideMenuVC.view.isHidden = true | ||
|
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.
q; shadowView를 sideMenuVC 외부에서 생성해서 insert 해주시는 이유가 있나용??
추가로 shadowView만 AutoLayout이 아니라 frame + autoresizingMask를 적용하신 이유도 궁금합니당
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.
처음에는 홈뷰컨과 사이드바뷰컨 사이를 가려주는거라 외부인 containerVC에서 생성해주는 맞다고 생각했었습니다.
그런데 이걸 홈뷰컨에 insert해서 서치바가 안가려지는 문제가 있었는데 이걸 사이드바 뷰컨에 넣어줘서 해결했었습니다.
근데 지금 댓글을 보면서 사이드바 뷰컨에 옮겨야하나.. 고민하고 있었는데
containerVC에 view.insertSubview(shadowView, at: 1)로 해주니 아주 잘 가려지는군요..?
autoresizingMask를 쓴건 가로화면으로 전환했을 때, 넓이가 그대로 있는데 저걸 쓰면 다 가려주게되서 사용했습니다!
tapGesture.numberOfTapsRequired = 1 | ||
tapGesture.delegate = self | ||
tapGesture.isEnabled = true |
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.
p2; numberOfTapsRequired
랑 isEnabled
는 기본값이 1과 true라서 따로 지정안해주셔도 될 것 같습니당 🙂
func addTarget(_ target: Any?, action: Selector, for event: UIControl.Event) { | ||
editButton.addTarget(target, action: action, for: event) | ||
} |
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.
p3; 이렇게 되면 이 메서드를 사용할 때 ProfileLabel
이라는 view에 addTarget
하는 것 같지만 editButton
에만 addTarget
이 되어서 뭔가 역할이 좀 모호한? 느낌이 드는 것 같아요!
사용하는 VC에서 editButton
에 대해 addTarget
에 필요한 것이라면 editButton
에 직접 addTarget
해줘도 되지않을까용
editButton
만 private
이 풀려있는 것이 그걸 의도하셨던 것 같기도,,,
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.
맞습니다 고민하다가 함수 만들어줬었는데 수정 바로 하겠습니다
코드리뷰 내용 반영하고 애니메이션도 추가했습니다! Simulator.Screen.Recording.-.iPhone.15.Pro.-.2023-11-27.at.21.22.08.mp4 |
헉 애니메이션 최곤데요 🥹 넘 예뻐요 🌈
코멘트 달아놨었는데 이건 어떻게 생각하시나요 ?! |
오오 애니메이션 넘 멋져요!!! 🙌 |
🌎 PR 요약
사이드 바 UI를 작업했어요.
🌱 작업한 브랜치
📚 작업한 내용
📍 참고 사항
📸 스크린샷
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2023-11-27.at.12.59.57.mp4
관련 이슈