Skip to content

Commit

Permalink
bug(@capacitor/screen-orientation): iOS landscape lock using incorrec…
Browse files Browse the repository at this point in the history
…t mappings (#2049)
  • Loading branch information
brian-weasner committed Apr 18, 2024
1 parent ac06c71 commit f08fa11
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions screen-orientation/ios/Plugin/ScreenOrientation.swift
Expand Up @@ -85,9 +85,11 @@ public class ScreenOrientation: NSObject {
case "any":
return UIInterfaceOrientationMask.all
case "landscape", "landscape-primary":
return UIInterfaceOrientationMask.landscapeLeft
case "landscape-secondary":
// UIInterfaceOrientationMask.landscapeRight is the same as UIDeviceOrientation.landscapeLeft
return UIInterfaceOrientationMask.landscapeRight
case "landscape-secondary":
// UIInterfaceOrientationMask.landscapeLeft is the same as UIDeviceOrientation.landscapeRight
return UIInterfaceOrientationMask.landscapeLeft
case "portrait-secondary":
return UIInterfaceOrientationMask.portraitUpsideDown
default:
Expand All @@ -101,9 +103,15 @@ public class ScreenOrientation: NSObject {
case "any":
return UIInterfaceOrientation.unknown.rawValue
case "landscape", "landscape-primary":
return UIInterfaceOrientation.landscapeLeft.rawValue
case "landscape-secondary":
// UIInterfaceOrientation.landscapeRight is the same as UIDeviceOrientation.landscapeLeft
// @see https://developer.apple.com/documentation/uikit/uiinterfaceorientation/landscaperight
// @see https://developer.apple.com/documentation/uikit/uideviceorientation/landscapeleft
return UIInterfaceOrientation.landscapeRight.rawValue
case "landscape-secondary":
// UIInterfaceOrientation.landscapeLeft is the same as UIDeviceOrientation.landscapeRight
// @see https://developer.apple.com/documentation/uikit/uiinterfaceorientation/landscapeleft
// @see https://developer.apple.com/documentation/uikit/uideviceorientation/landscaperight
return UIInterfaceOrientation.landscapeLeft.rawValue
case "portrait-secondary":
return UIInterfaceOrientation.portraitUpsideDown.rawValue
default:
Expand Down

0 comments on commit f08fa11

Please sign in to comment.