[#417] sceneWidth를 사용해서 프레임 크기를 잡은 ui를 재구성한다#431
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
이번 PR은 에셋의 idiom 설정을 universal로 변경하고, 여러 UI 컴포넌트에서 sceneWidth 의존성을 제거하여 폰트 크기 기반의 레이아웃으로 개선하는 작업을 포함합니다. 주요 변경 사항으로 LoginButton의 레이아웃 단순화와 HeatmapView의 GeometryReader를 이용한 크기 추적 로직 도입이 있습니다. 리뷰 피드백에서는 Dynamic Type 대응을 위해 UIFont.preferredFont 대신 @ScaledMetric 사용을 권장하였으며, HeatmapView에서 스크롤을 비활성화할 경우 발생할 수 있는 가독성 및 사용자 경험 문제를 지적했습니다.
| @State private var text = "" | ||
| @State private var height = CGFloat.zero | ||
| let action: () -> Void | ||
| private let height = UIFont.preferredFont(forTextStyle: .body).lineHeight |
Contributor
There was a problem hiding this comment.
UIFont.preferredFont를 사용하여 높이를 계산하는 대신, SwiftUI의 @ScaledMetric을 사용하는 것이 좋습니다. @ScaledMetric은 Dynamic Type 설정 변경에 따라 자동으로 값을 업데이트하며, SwiftUI의 선언적 스타일에 더 적합합니다. .body 스타일의 기본 line height인 22를 기준으로 설정할 수 있습니다.
Suggested change
| private let height = UIFont.preferredFont(forTextStyle: .body).lineHeight | |
| @ScaledMetric(relativeTo: .body) private var height: CGFloat = 22 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 연관된 이슈
📝 작업 내용
📌 요약
🔍 상세
📸 영상 / 이미지 (Optional)