[#327] TodoListView에서 스크롤을 하면 ui가 멈추는 현상을 해결한다#328
Merged
Conversation
Owner
opficdev
commented
Mar 28, 2026
- closed TodoListView에서 스크롤을 하면 ui가 멈추는 현상을 해결한다 #327
DevLog/UI/Home/TodoListView.swift
Outdated
Comment on lines
305
to
310
| .onAppear { | ||
| headerHeight = geometry.size.height + 1 | ||
| headerHeight = geometry.size.height.rounded() | ||
| } | ||
| .onChange(of: geometry.size.height) { _, height in | ||
| headerHeight = height + 1 | ||
| headerHeight = height.rounded() | ||
| } |
Contributor
There was a problem hiding this comment.
iOS 17부터 onChange 수정자에 initial 파라미터가 추가되어 onAppear와 onChange를 하나로 합칠 수 있습니다. 코드를 더 간결하게 만들 수 있으니 적용해보시는 것을 추천합니다.
Suggested change
| .onAppear { | |
| headerHeight = geometry.size.height + 1 | |
| headerHeight = geometry.size.height.rounded() | |
| } | |
| .onChange(of: geometry.size.height) { _, height in | |
| headerHeight = height + 1 | |
| headerHeight = height.rounded() | |
| } | |
| .onChange(of: geometry.size.height, initial: true) { _, height in | |
| headerHeight = height.rounded() | |
| } |
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.