Conversation
… a Sendable closure 해결
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 Pull Request는 TodoEditorView에서 콘텐츠 편집 시 키보드 활성화 상태에서 발생하는 스크롤 문제를 해결하는 데 중점을 둡니다. 이를 위해 SwiftUI의 기본 TextEditor 대신, UITextView를 기반으로 하는 새로운 UIKitTextEditor 컴포넌트를 도입했습니다. 이 커스텀 컴포넌트는 동적 높이 조절, 플레이스홀더 지원, 그리고 특히 키보드 등장 시 상위 스크롤 뷰의 오프셋을 보존하고 복원하는 기능을 포함하여, 편집 경험을 크게 개선합니다. 또한, 미리보기 전환 로직을 리팩토링하여 포커스 관리를 더욱 견고하게 만들었습니다. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
| DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in | ||
| self?.restoreAncestorScrollOffsetIfNeeded() | ||
| self?.preservedContentOffset = nil | ||
| } |
There was a problem hiding this comment.
DispatchQueue.main.asyncAfter를 사용하여 0.1초의 고정된 지연 시간을 주는 것은 불안정할 수 있습니다. 디바이스의 성능이나 시스템 상태에 따라 이 시간이 충분하지 않아 버그가 발생할 수 있습니다.
더 안정적인 방법으로 UIResponder.keyboardWillShowNotification 또는 UIResponder.keyboardDidShowNotification과 같은 키보드 노티피케이션을 구독하여 키보드 애니메이션과 동기화하거나, UIScrollView의 contentOffset을 KVO로 관찰하여 변경에 대응하는 것을 고려해 보시는 것이 좋겠습니다.
| ), | ||
| prompt: Text("설명(선택)").foregroundColor(Color.secondary), | ||
| axis: .vertical | ||
| placeholder: "설명(선택)" |
There was a problem hiding this comment.
placeholder에 문자열을 직접 하드코딩하면 국제화가 지원되지 않는 문제가 있습니다. 기존 TextField의 prompt에서는 Text 뷰를 통해 자동적으로 지역화가 이루어졌습니다.
Localizable.xcstrings 파일에 "설명(선택)" 키를 다시 추가하고, 이 곳에서는 String(localized: "설명(선택)") 또는 NSLocalizedString를 사용하여 지역화된 문자열을 사용하도록 수정하는 것이 좋겠습니다.
| placeholder: "설명(선택)" | |
| placeholder: String(localized: "설명(선택)") |
Uh oh!
There was an error while loading. Please reload this page.