fix: Swift 6 strict concurrency 경고 수정#75
Merged
Conversation
Owner
gomminjae
commented
Mar 28, 2026
- AppState, TabSelection, ExploreIntent, NetworkStatusManager에 @mainactor 추가
- 전체 UseCase/Repository 프로토콜에 Sendable 준수 추가
- AppDIContainer에 @mainactor 추가
- FilterBottomSheet PreferenceKey에 nonisolated(unsafe) 적용
- AppState, TabSelection, ExploreIntent, NetworkStatusManager에 @mainactor 추가 - 전체 UseCase/Repository 프로토콜에 Sendable 준수 추가 - AppDIContainer에 @mainactor 추가 - FilterBottomSheet PreferenceKey에 nonisolated(unsafe) 적용 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request implements Swift concurrency updates across multiple modules by adding @mainactor to several classes and ensuring protocol conformance to Sendable. These changes improve thread safety and align with modern Swift concurrency requirements. A suggestion was made in FilterBottomSheet.swift to use a non-isolated computed property for defaultValue instead of nonisolated(unsafe) to avoid the unsafe keyword while maintaining thread safety.
|
|
||
| private struct HeightKey: PreferenceKey { | ||
| static var defaultValue: CGFloat = 0 | ||
| nonisolated(unsafe) static var defaultValue: CGFloat = 0 |
There was a problem hiding this comment.
nonisolated(unsafe)를 사용하여 동시성 경고를 해결하는 것도 방법이지만, defaultValue에 대해 계산 프로퍼티(computed property)를 사용하는 것이 더 안전하고 깔끔한 접근 방식입니다. 이렇게 하면 unsafe 키워드 사용을 피할 수 있으며, 이 값이 상수임을 명확히 하여 기본값의 본질에 더 잘 부합하게 됩니다.
Suggested change
| nonisolated(unsafe) static var defaultValue: CGFloat = 0 | |
| nonisolated static var defaultValue: CGFloat { 0 } |
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.