From 33630816c7e77fd989fc3479a794decf5ce1a018 Mon Sep 17 00:00:00 2001 From: Ilias Pavlidakis Date: Wed, 30 Apr 2025 09:47:32 +0100 Subject: [PATCH 1/3] [Enhancement]Increase Swift Version to 6.0 --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 7ebcc935a..1a8597404 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:6.0 import Foundation import PackageDescription From fde8ca6d311667927073820fc45f4143c980746c Mon Sep 17 00:00:00 2001 From: Ilias Pavlidakis Date: Wed, 30 Apr 2025 09:52:30 +0100 Subject: [PATCH 2/3] Change swift version everywhere --- .swiftformat | 2 +- README.md | 2 +- .../MediaAdapters/VideoMediaAdapter.swift | 14 +++++++------- .../CallingViews/LobbyViewModel.swift | 2 +- StreamVideo-XCFramework.podspec | 2 +- StreamVideo.podspec | 2 +- StreamVideoSwiftUI-XCFramework.podspec | 2 +- StreamVideoSwiftUI.podspec | 2 +- .../Extensions/Foundation/Task_TimeoutTests.swift | 2 +- StreamVideoUIKit-XCFramework.podspec | 2 +- StreamVideoUIKit.podspec | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.swiftformat b/.swiftformat index 069dc9c39..a7f8d7d74 100644 --- a/.swiftformat +++ b/.swiftformat @@ -1,6 +1,6 @@ # Stream rules --header "\nCopyright © {year} Stream.io Inc. All rights reserved.\n" ---swiftversion 5.9 +--swiftversion 6.0 --ifdef no-indent --disable redundantType diff --git a/README.md b/README.md index 849499b70..c13be4517 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@

- +

StreamVideo diff --git a/Sources/StreamVideo/WebRTC/v2/PeerConnection/MediaAdapters/VideoMediaAdapter.swift b/Sources/StreamVideo/WebRTC/v2/PeerConnection/MediaAdapters/VideoMediaAdapter.swift index f6c2106b2..630bbd29a 100644 --- a/Sources/StreamVideo/WebRTC/v2/PeerConnection/MediaAdapters/VideoMediaAdapter.swift +++ b/Sources/StreamVideo/WebRTC/v2/PeerConnection/MediaAdapters/VideoMediaAdapter.swift @@ -168,7 +168,7 @@ final class VideoMediaAdapter: MediaAdapting, @unchecked Sendable { func didUpdateCameraPosition( _ position: AVCaptureDevice.Position ) async throws { - try await(localMediaManager as? LocalVideoMediaAdapter)? + try await (localMediaManager as? LocalVideoMediaAdapter)? .didUpdateCameraPosition(position) } @@ -184,14 +184,14 @@ final class VideoMediaAdapter: MediaAdapting, @unchecked Sendable { /// /// - Parameter factor: The zoom factor. func zoom(by factor: CGFloat) async throws { - try await(localMediaManager as? LocalVideoMediaAdapter)?.zoom(by: factor) + try await (localMediaManager as? LocalVideoMediaAdapter)?.zoom(by: factor) } /// Focuses the camera at a given point. /// /// - Parameter point: The point to focus on. func focus(at point: CGPoint) async throws { - try await(localMediaManager as? LocalVideoMediaAdapter)?.focus(at: point) + try await (localMediaManager as? LocalVideoMediaAdapter)?.focus(at: point) } /// Adds a video output to the capture session. @@ -200,7 +200,7 @@ final class VideoMediaAdapter: MediaAdapting, @unchecked Sendable { func addVideoOutput( _ videoOutput: AVCaptureVideoDataOutput ) async throws { - try await(localMediaManager as? LocalVideoMediaAdapter)?.addVideoOutput(videoOutput) + try await (localMediaManager as? LocalVideoMediaAdapter)?.addVideoOutput(videoOutput) } /// Removes a video output from the capture session. @@ -209,7 +209,7 @@ final class VideoMediaAdapter: MediaAdapting, @unchecked Sendable { func removeVideoOutput( _ videoOutput: AVCaptureVideoDataOutput ) async throws { - try await(localMediaManager as? LocalVideoMediaAdapter)?.removeVideoOutput(videoOutput) + try await (localMediaManager as? LocalVideoMediaAdapter)?.removeVideoOutput(videoOutput) } /// Adds a photo output to the capture session. @@ -218,7 +218,7 @@ final class VideoMediaAdapter: MediaAdapting, @unchecked Sendable { func addCapturePhotoOutput( _ capturePhotoOutput: AVCapturePhotoOutput ) async throws { - try await(localMediaManager as? LocalVideoMediaAdapter)? + try await (localMediaManager as? LocalVideoMediaAdapter)? .addCapturePhotoOutput(capturePhotoOutput) } @@ -228,7 +228,7 @@ final class VideoMediaAdapter: MediaAdapting, @unchecked Sendable { func removeCapturePhotoOutput( _ capturePhotoOutput: AVCapturePhotoOutput ) async throws { - try await(localMediaManager as? LocalVideoMediaAdapter)? + try await (localMediaManager as? LocalVideoMediaAdapter)? .removeCapturePhotoOutput(capturePhotoOutput) } diff --git a/Sources/StreamVideoSwiftUI/CallingViews/LobbyViewModel.swift b/Sources/StreamVideoSwiftUI/CallingViews/LobbyViewModel.swift index 048c593c3..13a431757 100644 --- a/Sources/StreamVideoSwiftUI/CallingViews/LobbyViewModel.swift +++ b/Sources/StreamVideoSwiftUI/CallingViews/LobbyViewModel.swift @@ -56,7 +56,7 @@ public class LobbyViewModel: ObservableObject, @unchecked Sendable { (camera as? Camera)?.switchCaptureDevice() } Task { - await(camera as? Camera)?.start() + await (camera as? Camera)?.start() } } } diff --git a/StreamVideo-XCFramework.podspec b/StreamVideo-XCFramework.podspec index 60afe48e5..ca4e944cd 100644 --- a/StreamVideo-XCFramework.podspec +++ b/StreamVideo-XCFramework.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.author = { 'getstream.io' => 'support@getstream.io' } spec.social_media_url = 'https://getstream.io' - spec.swift_version = '5.9' + spec.swift_version = '6.0' spec.platform = :ios, '13.0' spec.requires_arc = true diff --git a/StreamVideo.podspec b/StreamVideo.podspec index 1ccd2b433..aa6eb7e38 100644 --- a/StreamVideo.podspec +++ b/StreamVideo.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.author = { 'getstream.io' => 'support@getstream.io' } spec.social_media_url = 'https://getstream.io' - spec.swift_version = '5.9' + spec.swift_version = '6.0' spec.platform = :ios, '13.0' spec.requires_arc = true diff --git a/StreamVideoSwiftUI-XCFramework.podspec b/StreamVideoSwiftUI-XCFramework.podspec index 437e98357..9fd9a93c1 100644 --- a/StreamVideoSwiftUI-XCFramework.podspec +++ b/StreamVideoSwiftUI-XCFramework.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.author = { 'getstream.io' => 'support@getstream.io' } spec.social_media_url = 'https://getstream.io' - spec.swift_version = '5.9' + spec.swift_version = '6.0' spec.platform = :ios, '13.0' spec.requires_arc = true diff --git a/StreamVideoSwiftUI.podspec b/StreamVideoSwiftUI.podspec index 51162f933..45b46b065 100644 --- a/StreamVideoSwiftUI.podspec +++ b/StreamVideoSwiftUI.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.author = { 'getstream.io' => 'support@getstream.io' } spec.social_media_url = 'https://getstream.io' - spec.swift_version = '5.9' + spec.swift_version = '6.0' spec.platform = :ios, '13.0' spec.requires_arc = true diff --git a/StreamVideoTests/WebRTC/Extensions/Foundation/Task_TimeoutTests.swift b/StreamVideoTests/WebRTC/Extensions/Foundation/Task_TimeoutTests.swift index f4250889e..0bbf4aad8 100644 --- a/StreamVideoTests/WebRTC/Extensions/Foundation/Task_TimeoutTests.swift +++ b/StreamVideoTests/WebRTC/Extensions/Foundation/Task_TimeoutTests.swift @@ -54,7 +54,7 @@ final class TaskTimeoutTests: XCTestCase, @unchecked Sendable { return "Task 2" }.value - let (result1, result2) = try await(task1, task2) + let (result1, result2) = try await (task1, task2) XCTAssertEqual(result1, "Task 1") XCTAssertEqual(result2, "Task 2") diff --git a/StreamVideoUIKit-XCFramework.podspec b/StreamVideoUIKit-XCFramework.podspec index da8365da3..f7633ab17 100644 --- a/StreamVideoUIKit-XCFramework.podspec +++ b/StreamVideoUIKit-XCFramework.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.author = { 'getstream.io' => 'support@getstream.io' } spec.social_media_url = 'https://getstream.io' - spec.swift_version = '5.9' + spec.swift_version = '6.0' spec.platform = :ios, '13.0' spec.requires_arc = true diff --git a/StreamVideoUIKit.podspec b/StreamVideoUIKit.podspec index 9ff6b6b06..1cecc529e 100644 --- a/StreamVideoUIKit.podspec +++ b/StreamVideoUIKit.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.author = { 'getstream.io' => 'support@getstream.io' } spec.social_media_url = 'https://getstream.io' - spec.swift_version = '5.9' + spec.swift_version = '6.0' spec.platform = :ios, '13.0' spec.requires_arc = true From 8721b3441d1d774a01c14f42ee633fc188ba1a07 Mon Sep 17 00:00:00 2001 From: Ilias Pavlidakis Date: Wed, 30 Apr 2025 14:32:27 +0100 Subject: [PATCH 3/3] Fix errors --- Sources/StreamVideoSwiftUI/CallViewModel.swift | 2 +- .../CallingViews/iOS13/BackportStateObject.swift | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/StreamVideoSwiftUI/CallViewModel.swift b/Sources/StreamVideoSwiftUI/CallViewModel.swift index a95d57b3e..1104eaff2 100644 --- a/Sources/StreamVideoSwiftUI/CallViewModel.swift +++ b/Sources/StreamVideoSwiftUI/CallViewModel.swift @@ -715,7 +715,7 @@ open class CallViewModel: ObservableObject { Task { @MainActor [weak self] in guard let self = self else { return } log.debug("Detected ringing timeout, hanging up...") - handleCallHangUp(ringTimeout: true) + self.handleCallHangUp(ringTimeout: true) } } ) diff --git a/Sources/StreamVideoSwiftUI/CallingViews/iOS13/BackportStateObject.swift b/Sources/StreamVideoSwiftUI/CallingViews/iOS13/BackportStateObject.swift index 39d8ecfe7..425b6e556 100644 --- a/Sources/StreamVideoSwiftUI/CallingViews/iOS13/BackportStateObject.swift +++ b/Sources/StreamVideoSwiftUI/CallingViews/iOS13/BackportStateObject.swift @@ -7,6 +7,7 @@ import SwiftUI /// A property wrapper type that instantiates an observable object. @propertyWrapper @available(iOS, introduced: 13, obsoleted: 14) +@MainActor public final class BackportStateObject: DynamicProperty, @unchecked Sendable where ObjectType.ObjectWillChangePublisher == ObservableObjectPublisher {