Skip to content

Commit 3a024f9

Browse files
- Updated concurrency to work with xcode 14
1 parent 8c7e4a7 commit 3a024f9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Sources/AboutWindow/Views/TrackableScrollView.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010

1111
import SwiftUI
1212

13+
@MainActor
1314
private struct ScrollViewOffsetPreferenceKey: @preconcurrency PreferenceKey {
1415
typealias Value = [CGFloat]
1516

16-
@MainActor static var defaultValue: [CGFloat] = [0]
17+
static var defaultValue: [CGFloat] = [0]
1718

18-
static func reduce(value: inout [CGFloat], nextValue: () -> [CGFloat]) {
19+
nonisolated static func reduce(value: inout [CGFloat], nextValue: () -> [CGFloat]) {
1920
value.append(contentsOf: nextValue())
2021
}
2122
}
@@ -79,7 +80,7 @@ struct TrackableScrollView<Content>: View where Content: View {
7980
}
8081
}
8182
}
82-
.onPreferenceChange(ScrollViewOffsetPreferenceKey.self) { value in
83+
.onPreferenceChange(ScrollViewOffsetPreferenceKey.self) { @MainActor value in
8384
self.contentOffset = value[0]
8485
if self.contentTrailingOffset != nil {
8586
self.contentTrailingOffset = value[1]

0 commit comments

Comments
 (0)