Skip to content

Commit a414910

Browse files
committed
support dark mode switching in StyledEdgeNode
1 parent ce33193 commit a414910

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Sources/Components/Compositions/StyledEdgeNode.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public class StyledEdgeNode<ContentNode: ASDisplayNode>: NamedDisplayNodeBase {
233233
defer {
234234
CATransaction.commit()
235235
}
236-
236+
s
237237
switch self.cornerRoundingStrategy {
238238
case .clip(let assimilationColor):
239239

@@ -302,6 +302,19 @@ public class StyledEdgeNode<ContentNode: ASDisplayNode>: NamedDisplayNodeBase {
302302

303303
}
304304

305+
public override func asyncTraitCollectionDidChange(
306+
withPreviousTraitCollection previousTraitCollection: ASPrimitiveTraitCollection
307+
) {
308+
super.asyncTraitCollectionDidChange(withPreviousTraitCollection: previousTraitCollection)
309+
let userInterfaceStyle = asyncTraitCollection().userInterfaceStyle
310+
guard
311+
previousTraitCollection.userInterfaceStyle != userInterfaceStyle
312+
else {
313+
return
314+
}
315+
self.updateStrategy()
316+
}
317+
305318
}
306319

307320
extension ShapeDisplaying {

0 commit comments

Comments
 (0)