File tree Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Original file line number Diff line number Diff line change
1
+ import Foundation
2
+
3
+ public var isPerceptionCheckingEnabled : Bool {
4
+ get { perceptionChecking. isPerceptionCheckingEnabled }
5
+ set { perceptionChecking. isPerceptionCheckingEnabled = newValue }
6
+ }
7
+
8
+ private let perceptionChecking = PerceptionChecking ( )
9
+
10
+ private class PerceptionChecking : @unchecked Sendable {
11
+ var isPerceptionCheckingEnabled : Bool {
12
+ get {
13
+ lock. lock ( )
14
+ defer { lock. unlock ( ) }
15
+ return _isPerceptionCheckingEnabled
16
+ }
17
+ set {
18
+ lock. lock ( )
19
+ defer { lock. unlock ( ) }
20
+ _isPerceptionCheckingEnabled = newValue
21
+ }
22
+ }
23
+ let lock = NSLock ( )
24
+ #if DEBUG
25
+ var _isPerceptionCheckingEnabled = true
26
+ #else
27
+ var _isPerceptionCheckingEnabled = false
28
+ #endif
29
+ }
Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ extension PerceptionRegistrar: Hashable {
196
196
#if DEBUG
197
197
private func perceptionCheck( ) {
198
198
if
199
+ isPerceptionCheckingEnabled,
199
200
!_PerceptionLocals. isInPerceptionTracking,
200
201
!_PerceptionLocals. skipPerceptionChecking,
201
202
isInSwiftUIBody ( )
Original file line number Diff line number Diff line change @@ -118,11 +118,11 @@ extension WithPerceptionTracking: TableColumnContent where Content: TableColumnC
118
118
self . content = content
119
119
}
120
120
121
- public var tableColumnBody : Never {
121
+ nonisolated public var tableColumnBody : Never {
122
122
fatalError ( )
123
123
}
124
124
125
- public static func _makeContent(
125
+ nonisolated public static func _makeContent(
126
126
content: _GraphValue < WithPerceptionTracking < Content > > , inputs: _TableColumnInputs
127
127
) -> _TableColumnOutputs {
128
128
Content . _makeContent ( content: content [ \. body] , inputs: inputs)
@@ -141,7 +141,7 @@ extension WithPerceptionTracking: TableRowContent where Content: TableRowContent
141
141
self . content = content
142
142
}
143
143
144
- public var tableRowBody : Never {
144
+ nonisolated public var tableRowBody : Never {
145
145
fatalError ( )
146
146
}
147
147
}
You can’t perform that action at this time.
0 commit comments