Skip to content

Commit ca59709

Browse files
committed
Update README.md
1 parent 162790c commit ca59709

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ When you use the `addVector` command, you can dynamically add a new vector graph
5757
- The `clear` parameter determines whether existing vector layers should be removed before adding the new one. If set to `true`, all existing vector layers are cleared, and only the new layer will be displayed.
5858
- The vector layer will be laid out directly over the video stream, allowing it to appear as part of the video playback experience.
5959

60-
These commands allow you to seamlessly manage vector elements over a video, providing flexible options for adding and removing visual enhancements during playback. By leveraging the `ShapeLayerBuilderProtocol`, you can create custom vector graphics that integrate smoothly into the video content.
60+
**Important Lifecycle Consideration**:
61+
Integrating vector graphics into SwiftUI views, particularly during lifecycle events such as onAppear, requires careful consideration of underlying system behaviors. When vectors are added as the view appears, developers might encounter issues where the builder receives frame and bounds values of zero. This discrepancy stems from the inherent mismatch between the lifecycle of SwiftUI views and the lifecycle of UIView or NSView, depending on the platform. SwiftUI defers much of its view layout and rendering to a later stage in the view lifecycle. To mitigate these issues, a small delay can be introduced during onAppear. I'll try to add this command in the initial config later to cover the case when you need a vector layer at the very early stage of the video streaming.
6162

6263
### Additional Notes on Brightness and Contrast
6364

0 commit comments

Comments
 (0)