We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8861239 commit 8f8ba70Copy full SHA for 8f8ba70
1 file changed
Sources/NextcloudKit/Utils/SynchronizedNKSessionArray.swift
@@ -44,6 +44,14 @@ public final class SynchronizedNKSessionArray: @unchecked Sendable {
44
queue.sync { array }
45
}
46
47
+ /// Calls the given closure on each session in the array, in order.
48
+ /// - Parameter body: A closure that takes a `NKSession` as a parameter.
49
+ public func forEach(_ body: (NKSession) -> Void) {
50
+ queue.sync {
51
+ array.forEach(body)
52
+ }
53
54
+
55
/// Returns the first session matching a given account string.
56
/// - Parameter account: The account identifier string to match.
57
/// - Returns: A `NKSession` instance if found, otherwise `nil`.
0 commit comments