-
Notifications
You must be signed in to change notification settings - Fork 0
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] #178-bottomsheet라이브러리로 구현 #181
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.
라이브러리로 만드셔서 보기 좋네요! 다른 것도 모듈화한다면 도움이 될 것 같습니다.
.navigationBarHidden(true) | ||
.navigationBarHidden(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.
엥? 이게뭐죠ㅋㅋㅋ
lhs.latitude == rhs.latitude && | ||
lhs.longitude == rhs.longitude && | ||
lhs.categoryColorResponse == rhs.categoryColorResponse | ||
return lhs.placeId == rhs.placeId |
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.
필요한 부분만 남기는거 깔끔하네요
@State private var currentStyle: BottomSheetStyle = .half | ||
|
||
var body: some View { | ||
GeometryReader { geo in |
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.
반드시 GeometryReader
를 사용해야 한다면 GeometryReader
도 FlexSheet
에 넣어도 된다고 생각이 듭니다 .. 근데 GeometryReader
를 쓰는 이유가 뭐였죠??
- geo 값은 사용이 안 되는데 와일드카드 패턴을 써도 좋을 것 같아요
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.
GeometryReader는 바텀시트의 확장조건 ( .mini .half .full) 의 상황이 비율로 움직이고 있었는데 이 비율에 대한 부분을 감지하기 위해 사용되었습니다. 이부분은 라이브러리로 구현을 해놓은 상태이구요.
현재는 바텀시트가 full 인 상황에서 스크롤뷰를 움직일때 스크롤뷰의 스크롤 영역조절을 위해 작성을 해놧었는데,, 필요가 없었네요!
현재 geo 매개변수가 사용되지 않는것도 스크롤뷰처리를 따로 하지 않아도 되기 때문에 사용자체가 될곳이 없습니다.
해당 부분 통으로 삭제하도록 할게요!
@State private var currentStyle: BottomSheetStyle = .half | ||
|
||
var body: some View { | ||
GeometryReader { geo in |
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.
라이브러리로 빼니 깔끔해서 좋네요 !! 고생많으셨습니다 !
@State private var currentStyle: BottomSheetStyle = .half | ||
|
||
var body: some View { | ||
GeometryReader { geo in |
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.
GeometryReader를 쓰는 이유가 몰까요? 저번에 사용하지 않는 방향으로 수정하지 않았었나요. ?!!? 정말 기억이 나지 않아 물어봅니다...
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.
GeometryReader는 바텀시트의 확장조건 ( .mini .half .full) 의 상황이 비율로 움직이고 있었는데 이 비율에 대한 부분을 감지하기 위해 사용되었습니다. 이부분은 라이브러리로 구현을 해놓은 상태이구요.
현재는 바텀시트가 full 인 상황에서 스크롤뷰를 움직일때 스크롤뷰의 스크롤 영역조절을 위해 작성을 해놧었는데,, 필요가 없었네요!
현재 geo 매개변수가 사용되지 않는것도 스크롤뷰처리를 따로 하지 않아도 되기 때문에 사용자체가 될곳이 없습니다.
해당 부분 통으로 삭제하도록 할게요!
|
||
import SwiftUI | ||
|
||
struct ScrollOffsetPreferenceKey: PreferenceKey { |
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.
해당 코드도 필요없는게 맞네요! 라이브러리에 포함이 되어있어서 내부에서는 사용하지 않아도 됩니다
print("Failed to fetch data:", error) | ||
isLoading = false | ||
} | ||
await viewModel.fetchLocationList(locationId: locationId) |
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.
error throw 안되는 부분인가요?
🔗 연결된 이슈
📄 작업 내용
동작 내용은 기존과 동일해서 생략합니다.
💻 주요 코드 설명
BottomSheetStyle
,CustomBottomSheet
,FixedBottomSheetView
,BottomSheetList
,SearchResultBottomSheet
을 삭제하고 라이브러리로 통합 관리하게 되었습니다. 궁금하시면 라이브러리 코드 뜯어보시면 이해가 될겁니다.지금 코드는 라이브러리를 가져다 사용하는게 많아서 라이브러리 사용법으로 PR설명을 갈음하겟습니다.
👀 기타 더 이야기해볼 점
라이브러리 연동관련해서 코드가 좀 많이 더럽습니다 커밋단위말고 해당 PR 만 봐주세요!
![스크린샷 2025-02-10 오전 3 38 34](https://private-user-images.githubusercontent.com/109647045/411348970-d5a208ae-c55d-4fee-b65d-0a70bea0cf47.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0ODYzNDUsIm5iZiI6MTczOTQ4NjA0NSwicGF0aCI6Ii8xMDk2NDcwNDUvNDExMzQ4OTcwLWQ1YTIwOGFlLWM1NWQtNGZlZS1iNjVkLTBhNzBiZWEwY2Y0Ny5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxM1QyMjM0MDVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jMmIzZmU5YzgzNzcwMzRiMzc3YmI5MzBiMDdlN2FjNGVjZGZjNzk1ZWExY2FlYzI4M2I5ZjdjNmZjNzg5MTI1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.GIAnahfabJm52_qbZ7POR7Xuf-lgo5n6a6MUTHne3ms)
스유 정말 어렵네요,, 라이브러리도 어렵다..
참...많은일이 있었습니다 하하