File tree 3 files changed +9
-2
lines changed
3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -24,5 +24,6 @@ extension MCamera { @MainActor class Config {
24
24
25
25
// MARK: Others
26
26
var appDelegate : MApplicationDelegate . Type ? = nil
27
+ var originalOrientationLock : UIInterfaceOrientationMask = . all
27
28
var isCameraConfigured : Bool = false
28
29
} }
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ private extension MCamera {
144
144
}
145
145
private extension MCamera {
146
146
func lockScreenOrientation( _ orientation: UIInterfaceOrientationMask ? ) {
147
- config. appDelegate? . orientationLock = orientation ?? . all
147
+ config. appDelegate? . orientationLock = orientation ?? config . originalOrientationLock
148
148
UINavigationController . attemptRotationToDeviceOrientation ( )
149
149
}
150
150
func notifyUserOfMediaCaptured( _ capturedMedia: MCameraMedia ) {
Original file line number Diff line number Diff line change @@ -384,7 +384,13 @@ public extension MCamera {
384
384
}
385
385
```
386
386
*/
387
- func lockCameraInPortraitOrientation( _ appDelegate: MApplicationDelegate . Type ) -> Self { config. appDelegate = appDelegate; manager. attributes. orientationLocked = true ; return self }
387
+ func lockCameraInPortraitOrientation( _ appDelegate: MApplicationDelegate . Type ) -> Self {
388
+ config. appDelegate = appDelegate
389
+ config. originalOrientationLock = appDelegate. orientationLock
390
+ manager. attributes. orientationLocked = true
391
+
392
+ return self
393
+ }
388
394
389
395
/**
390
396
Starts the camera session.
You can’t perform that action at this time.
0 commit comments