Skip to content

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

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)

@realmtai
Copy link

realmtai commented Aug 5, 2025

Does the .lockCameraInPortraitOrientation lock work for you at all?

Turns out the lockCameraInPortraitOrientation doesn't work like how I want to "lock" the UI Controller. Turns out for my case of locking the UI is to NOT call the lockCameraInPortraitOrientation 🤦🏻‍♂️

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