fix: Swift concurrency warning for ScrollOffsetPreferenceKey
Mark defaultValue as nonisolated(unsafe) to fix Xcode Cloud build error: "Static property 'defaultValue' is not concurrency-safe because it is nonisolated global shared mutable state"
This commit is contained in:
@@ -688,7 +688,7 @@ struct ControlView: View {
|
||||
// MARK: - Scroll Offset Preference Key
|
||||
|
||||
private struct ScrollOffsetPreferenceKey: PreferenceKey {
|
||||
static var defaultValue: CGFloat = 0
|
||||
nonisolated(unsafe) static var defaultValue: CGFloat = 0
|
||||
static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) {
|
||||
value = nextValue()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user