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/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 diff --git a/README.md b/README.md index 112f5cc2d..42f5170b6 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/CallViewModel.swift b/Sources/StreamVideoSwiftUI/CallViewModel.swift index 9a581e844..ad9b947b4 100644 --- a/Sources/StreamVideoSwiftUI/CallViewModel.swift +++ b/Sources/StreamVideoSwiftUI/CallViewModel.swift @@ -714,7 +714,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/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/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 { diff --git a/StreamVideo-XCFramework.podspec b/StreamVideo-XCFramework.podspec index a60024847..81a9f666d 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 6fd8fdc50..9043f07e6 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 8162d9dd4..eb91b4481 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 e741a39fd..7a7ec38b2 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 4ec3e3287..a7d289567 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 537115d14..91bd236af 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