Skip to content

Fix orientation lock setting app to all after closing camera #105

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

samdogg7
Copy link

Noted in issue 89, after closing the Camera's session we reset the AppDelegate's orientation to all. This change will ensure we reset the orientation to the original state dictated by AppDelegate.

@samdogg7 samdogg7 requested a review from FulcrumOne as a code owner May 22, 2025 14:09
func lockCameraInPortraitOrientation(_ appDelegate: MApplicationDelegate.Type) -> Self { config.appDelegate = appDelegate; manager.attributes.orientationLocked = true; return self }
func lockCameraInPortraitOrientation(_ appDelegate: MApplicationDelegate.Type) -> Self {
config.appDelegate = appDelegate
config.originalOrientationLock = appDelegate.orientationLock
Copy link
Author

Choose a reason for hiding this comment

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

Captures the AppDelegate's orientationLock and stores it as a default

@@ -144,7 +144,7 @@ private extension MCamera {
}
private extension MCamera {
func lockScreenOrientation(_ orientation: UIInterfaceOrientationMask?) {
config.appDelegate?.orientationLock = orientation ?? .all
config.appDelegate?.orientationLock = orientation ?? config.originalOrientationLock
Copy link
Author

Choose a reason for hiding this comment

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

When calling lockScreenOrientation(nil) we will fallback to the original value set in AppDelegate (such as .portrait)

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.

1 participant