Skip to content

preview frame fix in case of using SwiftyCamViewController as a child vc#220

Open
PhilipDukhov wants to merge 2 commits intoAwalz:masterfrom
PhilipDukhov:feature/child-preview-frame-fix
Open

preview frame fix in case of using SwiftyCamViewController as a child vc#220
PhilipDukhov wants to merge 2 commits intoAwalz:masterfrom
PhilipDukhov:feature/child-preview-frame-fix

Conversation

@PhilipDukhov
Copy link

I want my camera to take part of the screen. In current code previewLayer.videoPreviewLayer.connection == nil until viewDidAppear, so the last time viewDidLayoutSubviews is called connection == nil, and the layer frame is not updated

// Preview layer video orientation can be set only after the connection is created
DispatchQueue.main.async {
self.previewLayer.videoPreviewLayer.connection?.videoOrientation = self.orientation.getPreviewLayerOrientation()
updatePreviewLayer()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot to add self here

self.updatePreviewLayer()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, fixed that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants