Skip to content

Commit df51fbf

Browse files
authored
Swift6 Migration (#684)
1 parent 6d8c429 commit df51fbf

File tree

400 files changed

+1813
-1555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

400 files changed

+1813
-1555
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
44

55
# Upcoming
66

7-
### 🔄 Changed
7+
### ✅ Added
8+
- Support for Swift 6 [#684](https://github.com/GetStream/stream-video-swift/pull/684)
89

910
# [1.17.0](https://github.com/GetStream/stream-video-swift/releases/tag/1.17.0)
1011
_February 14, 2025_

DemoApp/Sources/Components/DemoAppViewFactory.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ final class DemoAppViewFactory: ViewFactory {
9797
availableFrame: availableFrame,
9898
onChangeTrackVisibility: onChangeTrackVisibility
9999
)
100-
.snapshot(trigger: snapshotTrigger) { [weak viewModel] in viewModel?.sendSnapshot($0) }
100+
.snapshot(trigger: snapshotTrigger) { [weak viewModel] snapshot in
101+
Task { @MainActor [weak viewModel] in
102+
viewModel?.sendSnapshot(snapshot)
103+
}
104+
}
101105
.overlay(
102106
VStack {
103107
Spacer()

DemoApp/Sources/Components/MemoryLogDestination/MemoryLogDestination.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import Foundation
66
import StreamVideo
77

8-
final class MemoryLogDestination: BaseLogDestination {
8+
final class MemoryLogDestination: BaseLogDestination, @unchecked Sendable {
99

1010
override func process(logDetails: LogDetails) {
1111
LogQueue.insert(logDetails)

DemoApp/Sources/Components/MemoryLogDestination/OSLogDestination.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Foundation
66
import OSLog
77
import StreamVideo
88

9-
final class OSLogDestination: BaseLogDestination {
9+
final class OSLogDestination: BaseLogDestination, @unchecked Sendable {
1010

1111
private let loggers: [String: os.Logger] = LogSubsystem
1212
.allCases

DemoApp/Sources/Components/Reactions/ReactionsAdapter.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import Foundation
88
import StreamVideo
99
import SwiftUI
1010

11-
@MainActor
12-
final class ReactionsAdapter: ObservableObject {
11+
final class ReactionsAdapter: ObservableObject, @unchecked Sendable {
1312

1413
var streamVideo: StreamVideo? {
1514
didSet { didUpdate(streamVideo) }
@@ -35,8 +34,6 @@ final class ReactionsAdapter: ObservableObject {
3534

3635
@Published var activeReactions: [String: [Reaction]] = [:]
3736

38-
// MARK: - Lifecycle
39-
4037
// MARK: - Actions
4138

4239
func send(reaction: Reaction) {
@@ -215,7 +212,7 @@ final class ReactionsAdapter: ObservableObject {
215212
}
216213

217214
extension ReactionsAdapter: InjectionKey {
218-
static var currentValue: ReactionsAdapter = .init()
215+
nonisolated(unsafe) static var currentValue: ReactionsAdapter = .init()
219216
}
220217

221218
extension InjectedValues {

DemoApp/Sources/Components/Router.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ final class Router: ObservableObject {
239239
}
240240
}
241241

242-
private func refreshToken(
242+
private nonisolated func refreshToken(
243243
for userId: String,
244244
_ completionHandler: @escaping (Result<UserToken, Error>) -> Void
245245
) {

DemoApp/Sources/Extensions/CallStateResponseFields+Identifiable.swift

Lines changed: 0 additions & 12 deletions
This file was deleted.

DemoApp/Sources/Extensions/CallViewModel+Snapshot.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,3 @@ extension CallViewModel {
6464
return newImage
6565
}
6666
}
67-
68-
extension SendEventResponse: @unchecked Sendable {}

DemoApp/Sources/Extensions/DemoApp+Sentry.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func configureSentry() {
3434
}
3535
}
3636

37-
private final class SentryLogDestination: LogDestination {
37+
private final class SentryLogDestination: LogDestination, @unchecked Sendable {
3838
func write(message: String) {
3939
// TODO: remove me once this function is gone from the protocol
4040
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
//
2+
// Copyright © 2025 Stream.io Inc. All rights reserved.
3+
//
4+
5+
import Foundation
6+
import StreamVideo
7+
8+
#if compiler(>=6.0)
9+
extension TranscriptionSettings.Mode: @retroactive CustomStringConvertible {}
10+
extension TranscriptionSettings.ClosedCaptionMode: @retroactive CustomStringConvertible {}
11+
extension TranscriptionSettings.Language: @retroactive CustomStringConvertible {}
12+
#else
13+
extension TranscriptionSettings.Mode: CustomStringConvertible {}
14+
extension TranscriptionSettings.ClosedCaptionMode: CustomStringConvertible {}
15+
extension TranscriptionSettings.Language: CustomStringConvertible {}
16+
#endif
17+
18+
extension TranscriptionSettings.Mode {
19+
public var description: String {
20+
switch self {
21+
case .autoOn:
22+
return "auto-on"
23+
case .available:
24+
return "Available"
25+
case .disabled:
26+
return "Disabled"
27+
case .unknown:
28+
return "Unknown"
29+
}
30+
}
31+
}
32+
33+
extension TranscriptionSettings.ClosedCaptionMode {
34+
public var description: String {
35+
switch self {
36+
case .autoOn:
37+
return "auto-on"
38+
case .available:
39+
return "Available"
40+
case .disabled:
41+
return "Disabled"
42+
case .unknown:
43+
return "Unknown"
44+
}
45+
}
46+
}
47+
48+
extension TranscriptionSettings.Language {
49+
public var description: String {
50+
switch self {
51+
case .ar: return "Arabic"
52+
case .auto: return "Auto"
53+
case .ca: return "Catalan"
54+
case .cs: return "Czech"
55+
case .da: return "Danish"
56+
case .de: return "German"
57+
case .el: return "Greek"
58+
case .en: return "English"
59+
case .es: return "Spanish"
60+
case .fi: return "Finnish"
61+
case .fr: return "French"
62+
case .he: return "Hebrew"
63+
case .hi: return "Hindi"
64+
case .hr: return "Croatian"
65+
case .hu: return "Hungarian"
66+
case .id: return "Indonesian"
67+
case .it: return "Italian"
68+
case .ja: return "Japanese"
69+
case .ko: return "Korean"
70+
case .ms: return "Malay"
71+
case .nl: return "Dutch"
72+
case .no: return "Norwegian"
73+
case .pl: return "Polish"
74+
case .pt: return "Portuguese"
75+
case .ro: return "Romanian"
76+
case .ru: return "Russian"
77+
case .sv: return "Swedish"
78+
case .ta: return "Tamil"
79+
case .th: return "Thai"
80+
case .tl: return "Tagalog"
81+
case .tr: return "Turkish"
82+
case .uk: return "Ukrainian"
83+
case .zh: return "Chinese"
84+
case .unknown:
85+
return "Unknown"
86+
}
87+
}
88+
}

0 commit comments

Comments
 (0)