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

바텀시트 Constraint 리팩토링 + 애니메이션 코드 적용 #358

Merged
merged 16 commits into from
May 9, 2023

Conversation

WhiteHyun
Copy link
Member

@WhiteHyun WhiteHyun commented May 9, 2023

📌 PR 요약

🌱 작업한 내용

  • 기존 레거시 코드에 적용시켰던 animated: falsepresentationStyle = .overFullScreen을 제거하고, animated: true로 변경했습니다.
  • BottomSheet의 Constraints는 되도록 BaseBottomSheetVC의 Margin, Size 값으로 맞추도록 설정했습니다. (나중에 수정하기 편함!)

🌱 PR 포인트

  • SortBottomSheetView를 BottomSheetFilterView로 변경하였고, 내부 로직도 변경했습니다.
    • 알림에서도 똑같은 바텀시트 뷰를 사용하기 때문에, 이를 재사용하고자 initializer를 수정했습니다.
  • 이제 Grabber를 당기면 Context가 위로 올라갑니다. (이전에는 당겨도 View들(Context)이 고정이었음)

Note: 기존에는 Bottom을 기준으로 Constraint를 잡아 BottomSheet의 높이를 계산했다면, 이번 PR 이후로는 Top을 기준으로 높이를 계산하기 때문에, top의 constraint를 잡지 않으면 BottomSheet가 뜨질 않으니 유의해주세요!

📸 스크린샷

수정 후
BoardBottomSheet

📮 관련 이슈

bottom 대신에 top으로 제약조건이 잡히도록 수정했습니다.
이렇게 두면, 기준값이 top이 되기 때문에 나중에 사용자가 grabber를 잡아당길 때
끌려 올라가는 애니메이션을 줄 수 있게 됩니다.
- present 및 dismiss의 애니메이션을 true로 설정
- presentationStyle 제거
- SortType initializer를 제거하고, String타입의 text를 받는 initializer를 구현
-> 다른 곳에서 재사용 가능
@WhiteHyun WhiteHyun added 🍎 ConfigureUI 화면 프로토타입 UI 구현 D+2 일반적인 범주의 PR이에요. 이틀 이내에 리뷰 해주시면 됩니다 ♻️Refactoring labels May 9, 2023
@WhiteHyun WhiteHyun self-assigned this May 9, 2023
Copy link
Contributor

@dlrjswns dlrjswns left a comment

Choose a reason for hiding this comment

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

되게 빠른 시간내에 구현해주셨네요 !! 수고하셨어요 승현님 :)

Comment on lines 24 to 27
contentView.snp.makeConstraints {
$0.leading.trailing.equalToSuperview()
$0.bottom.equalTo(view.safeAreaLayoutGuide)
$0.top.equalTo(view.safeAreaLayoutGuide)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

이 부분 변경으로 앞으로 바텀시트사용할때 바텀이랑 높이 둘다 잡아두면 의도하신대로 구현할 수 있는건가요 ???

Copy link
Member Author

@WhiteHyun WhiteHyun May 9, 2023

Choose a reason for hiding this comment

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

이 부분 변경으로 앞으로 바텀시트사용할때 바텀이랑 높이 둘다 잡아두면 의도하신대로 구현할 수 있는건가요 ???

넵! top, bottom만 잘 맞춰주시면 됩니다!

Copy link
Contributor

@dlrjswns dlrjswns left a comment

Choose a reason for hiding this comment

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

급한건 아닌거같긴한데 바텀시트 올라오고나서 grabber잡고 움직일때 하단 좌우부분에 살짝씩 색상이 다른 뷰가 보이는거같아요 !! 추후에 수정해주시면 좋을꺼같아요 👍👍☺️

@WhiteHyun
Copy link
Member Author

급한건 아닌거같긴한데 바텀시트 올라오고나서 grabber잡고 움직일때 하단 좌우부분에 살짝씩 색상이 다른 뷰가 보이는거같아요 !! 추후에 수정해주시면 좋을꺼같아요 👍👍☺️

만약 스크린샷에서 하단 모서리 부분을 말씀하시는 거라면 이는 시뮬레이터 녹화할 때 나타나는 특징으로, 아이폰은 둥근 형태이지만 스크린샷은 사각형이기 때문에 어쩔 수 없이 발생하는 것 같더라구요. 테스트하면 잘 동작합니다!

@WhiteHyun WhiteHyun merged commit ca787db into develop May 9, 2023
@WhiteHyun WhiteHyun deleted the feat/357-BottomSheet/Refactoring branch May 9, 2023 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍎 ConfigureUI 화면 프로토타입 UI 구현 D+2 일반적인 범주의 PR이에요. 이틀 이내에 리뷰 해주시면 됩니다 ♻️Refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Bottom Sheet Refactoring
2 participants