Skip to content

[Enhancement]Increase Swift Version to 6.0 #791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.9
// swift-tools-version:6.0

import Foundation
import PackageDescription
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</p>
<p align="center">
<a href="https://getstream.io/video/docs/sdk/ios/"><img src="https://img.shields.io/badge/iOS-13%2B-lightblue" /></a>
<a href="https://swift.org"><img src="https://img.shields.io/badge/Swift-5.9%2B-orange.svg" /></a>
<a href="https://swift.org"><img src="https://img.shields.io/badge/Swift-6.0%2B-orange.svg" /></a>
</p>
<p align="center">
<img id="stream-video-label" alt="StreamVideo" src="https://img.shields.io/badge/StreamVideo-7.54%20MB-blue"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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)
}

Expand All @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideoSwiftUI/CallViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ObjectType: ObservableObject & Sendable>: DynamicProperty, @unchecked Sendable
where ObjectType.ObjectWillChangePublisher == ObservableObjectPublisher {

Expand Down
2 changes: 1 addition & 1 deletion StreamVideo-XCFramework.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion StreamVideo.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion StreamVideoSwiftUI-XCFramework.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion StreamVideoSwiftUI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion StreamVideoUIKit-XCFramework.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion StreamVideoUIKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down