Skip to content

Commit

Permalink
[Refactor] SingleSelectButtonItemable @unchecked Sendable -> Sendable…
Browse files Browse the repository at this point in the history
…로 코드 변경 (#617)

* [Refactor] SingleSelectButtonItemable @unchecked Sendable -> Sendable

* refactor: apply sendable
  • Loading branch information
MaraMincho authored Oct 5, 2024
1 parent 56b536b commit 4403c5f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation
import SSPersistancy

enum LoginType: String, Equatable, Encodable {
enum LoginType: String, Equatable, Encodable, Sendable {
case KAKAO
case APPLE
case GOOGLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import SSFirebase
// MARK: - CreateEnvelopeRouter

@Reducer
struct CreateEnvelopeRouter: @unchecked Sendable {
struct CreateEnvelopeRouter: Sendable {
@Dependency(\.createEnvelopeNetwork) var network

@ObservableState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public protocol SingleSelectButtonItemable: Identifiable, Equatable, Sendable {
public protocol SingleSelectButtonItemable: Identifiable, Equatable, Sendable where ID == Int {
var id: Int { get }
var title: String { get set }
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import Foundation

// MARK: - SingleSelectButtonProperty

/// SingleSelectButtonProperty입니다.
///
/// Unchecked Sendable인 이유는, Identifiable이 Sendable protocol을 만족하지 않기 때문입니다.
public struct SingleSelectButtonProperty<Item: SingleSelectButtonItemable>: Equatable, @unchecked Sendable {
public struct SingleSelectButtonProperty<Item: SingleSelectButtonItemable>: Equatable, Sendable {
/// 타이틀 텍스트 이릅입니다.
public var titleText: String
/// 커스텀 아이템을 제외한 아이템들을 보관합니다.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Foundation
@Reducer
public struct SingleSelectButtonReducer<Item: SingleSelectButtonItemable>: Sendable {
@ObservableState
public struct State: Equatable, @unchecked Sendable {
public struct State: Equatable, Sendable {
var isOnAppear = false
fileprivate var initialSelectedID: Item.ID?
@Shared var singleSelectButtonHelper: SingleSelectButtonProperty<Item>
Expand All @@ -36,7 +36,7 @@ public struct SingleSelectButtonReducer<Item: SingleSelectButtonItemable>: Senda
}

/// uncheckedSendable because of Identifiable
public enum Action: Equatable, @unchecked Sendable {
public enum Action: Equatable, Sendable {
case onAppear(Bool)
case tappedID(Item.ID?)
case tappedAddCustomButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public extension KeyboardReadable {

// MARK: - KeyBoardReadablePublisher

public final class KeyBoardReadablePublisher: KeyboardReadable, @unchecked Sendable {
public static let shared: KeyBoardReadablePublisher = .init()
public final class KeyBoardReadablePublisher: KeyboardReadable {
public nonisolated(unsafe) static let shared: KeyBoardReadablePublisher = .init()
private init() {}
}

0 comments on commit 4403c5f

Please sign in to comment.