Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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

@@ -430,6 +433,7 @@ open class SwiftyCamViewController: UIViewController {
// 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