Skip to content

fix: Swift 6 strict concurrency 경고 수정#75

Merged
gomminjae merged 1 commit intodevelopfrom
fix/swift6-concurrency-annotations
Mar 28, 2026
Merged

fix: Swift 6 strict concurrency 경고 수정#75
gomminjae merged 1 commit intodevelopfrom
fix/swift6-concurrency-annotations

Conversation

@gomminjae
Copy link
Copy Markdown
Owner

  • 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>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

nonisolated(unsafe)를 사용하여 동시성 경고를 해결하는 것도 방법이지만, defaultValue에 대해 계산 프로퍼티(computed property)를 사용하는 것이 더 안전하고 깔끔한 접근 방식입니다. 이렇게 하면 unsafe 키워드 사용을 피할 수 있으며, 이 값이 상수임을 명확히 하여 기본값의 본질에 더 잘 부합하게 됩니다.

Suggested change
nonisolated(unsafe) static var defaultValue: CGFloat = 0
nonisolated static var defaultValue: CGFloat { 0 }

@gomminjae gomminjae merged commit 8e23336 into develop Mar 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant