Skip to content

Commit c03a379

Browse files
committed
Fix: NextcloudFileProviderKit build with NextcloudKit.
NextcloudFileProviderKit was updated to use Swift 6 which imposes some upstream compatibility requirements on NextcloudKit. Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
1 parent 71c06c6 commit c03a379

6 files changed

Lines changed: 7 additions & 7 deletions

File tree

Sources/NextcloudKit/NKCommon.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public enum NKTypeReachability: Int, Sendable {
1414
}
1515

1616
public protocol NextcloudKitDelegate: AnyObject, Sendable {
17-
func authenticationChallenge(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void)
17+
func authenticationChallenge(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @Sendable @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void)
1818
func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession)
1919

2020
func networkReachabilityObserver(_ typeReachability: NKTypeReachability)

Sources/NextcloudKit/NKError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extension OCSPath {
3232
static var ocsXMLMsg: Self { ["d:error", "s:message"] }
3333
}
3434

35-
public struct NKError: Error, Equatable {
35+
public struct NKError: Error, Equatable, Sendable {
3636
static let internalError = -9999
3737
public let errorCode: Int
3838
public let errorDescription: String

Sources/NextcloudKit/NKRequestOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import Foundation
77

8-
public class NKRequestOptions: NSObject {
8+
final public class NKRequestOptions: NSObject, Sendable {
99
public let endpoint: String?
1010
public let version: String?
1111
internal(set) public var customHeader: [String: String]?

Sources/NextcloudKit/NextcloudKit+Download.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public extension NextcloudKit {
2626
requestHandler: @escaping (_ request: DownloadRequest) -> Void = { _ in },
2727
taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in },
2828
progressHandler: @escaping (_ progress: Progress) -> Void = { _ in },
29-
completionHandler: @escaping (_ account: String, _ etag: String?, _ date: Date?, _ lenght: Int64, _ headers: [AnyHashable: Any]?, _ afError: AFError?, _ nKError: NKError) -> Void) {
29+
completionHandler: @escaping (_ account: String, _ etag: String?, _ date: Date?, _ lenght: Int64, _ headers: [AnyHashable: any Sendable]?, _ afError: AFError?, _ nKError: NKError) -> Void) {
3030
var convertible: URLConvertible?
3131
if serverUrlFileName is URL {
3232
convertible = serverUrlFileName as? URLConvertible
@@ -103,7 +103,7 @@ public extension NextcloudKit {
103103
etag: String?,
104104
date: Date?,
105105
length: Int64,
106-
headers: [AnyHashable: Any]?,
106+
headers: [AnyHashable: any Sendable]?,
107107
afError: AFError?,
108108
nkError: NKError
109109
) {

Sources/NextcloudKit/NextcloudKit+WebDAV.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ public extension NextcloudKit {
11931193
showHiddenFiles: Bool,
11941194
account: String,
11951195
options: NKRequestOptions = NKRequestOptions(),
1196-
taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in }
1196+
taskHandler: @Sendable @escaping (_ task: URLSessionTask) -> Void = { _ in }
11971197
) async -> (
11981198
account: String,
11991199
items: [NKTrash]?,

Sources/NextcloudKit/NextcloudKit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import UIKit
1010
import Alamofire
1111
import SwiftyJSON
1212

13-
open class NextcloudKit {
13+
open class NextcloudKit: @unchecked Sendable {
1414
#if swift(<6.0)
1515
public static let shared: NextcloudKit = {
1616
let instance = NextcloudKit()

0 commit comments

Comments
 (0)