RSDAppOrientationLock

public protocol RSDAppOrientationLock : UIApplicationDelegate

As of this writing, there is no simple way for an application to allow selectively locking the orientation of the app to portrait, while still allowing some view controllers to require landscape. This is intended as a work-around for that limitation. Using this feature requires the view controller that needs to change the orientation to set the orientationLock in viewWillAppear and then clear the lock on viewDidAppear. syoung 08/15/2019

Seealso

RSDAppDelegate for an example implementation.
  • The default orientation lock if not overridden by setting the orientationLock property.

    Declaration

    Swift

    var defaultOrientationLock: UIInterfaceOrientationMask { get }
  • The orientationLock property is used to override the default allowed orientations.

    Declaration

    Swift

    var orientationLock: UIInterfaceOrientationMask? { get set }
  • appLock Extension method

    Convenience accessor for the appLock for applications where the app delegate implements this protocol.

    Declaration

    Swift

    public static var appLock: RSDAppOrientationLock? { get }