File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Sources/swiftui-loop-videoplayer/protocol Expand file tree Collapse file tree 2 files changed +4
-2
lines changed File renamed without changes.
Original file line number Diff line number Diff line change @@ -49,20 +49,22 @@ public protocol LayerMakerProtocol {
49
49
50
50
extension LayerMakerProtocol {
51
51
52
- @ MainActor
52
+
53
53
/// Adds a vector layer to the composite layer using a specified builder.
54
54
///
55
55
/// - Parameters:
56
56
/// - builder: An instance conforming to `ShapeLayerBuilderProtocol` that constructs the vector layer.
57
57
/// - clear: A Boolean value that indicates whether to clear existing vector layers before adding the new one.
58
+ @MainActor
58
59
func addVectorLayer( builder : any ShapeLayerBuilderProtocol , clear: Bool ) {
59
60
if clear{ removeAllVectors ( ) }
60
61
let layer = builder. build ( with: ( frame, bounds) )
61
62
compositeLayer. addSublayer ( layer)
62
63
}
63
64
64
- @ MainActor
65
+
65
66
/// Removes all vector layers from the composite layer.
67
+ @MainActor
66
68
func removeAllVectors( ) {
67
69
compositeLayer. sublayers? . forEach { $0. removeFromSuperlayer ( ) }
68
70
}
You can’t perform that action at this time.
0 commit comments