# \[iOS\] How to force landscape mode in fullscreen

**URL:** <https://community.bitmovin.com/t/ios-how-to-force-landscape-mode-in-fullscreen/2340>\
**Category:** Knowledge\
**Created:** [September 27, 2023, 10:25pm UTC](https://community.bitmovin.com/t/ios-how-to-force-landscape-mode-in-fullscreen/2340 "2023-09-27T22:25:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ludovic.michaud](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/ludovic.michaud/32/811_2.png) [@ludovic.michaud](https://community.bitmovin.com/u/ludovic.michaud)\
**Post date:** [September 27, 2023, 10:25pm UTC](https://community.bitmovin.com/t/ios-how-to-force-landscape-mode-in-fullscreen/2340/1 "2023-09-27T22:25:37Z")

</div>

Our [BasicFulscreenHandling sample app](https://github.com/bitmovin/bitmovin-player-ios-samples/tree/main/BasicFullscreenHandling) showcases how to react to the player switching to fullscreen mode, or change the default behaviour by, for instance, making the player switch to fullscreen upon screen rotation.

A pretty common use case is to force the player to switch to lanscape display upon the user triggering the fullscreen mode.

In order to achieve this, you can simply override the `updateLayoutOnFullscreenChange` function as below :

```swift
private func updateLayoutOnFullscreenChange(fullscreen: Bool) {
    self.fullscreen = fullscreen

    // Update navigation bar
    navigationController?.setNavigationBarHidden(fullscreen, animated: true)

    // Force Orientation of the Application when entering or exiting fullscreen
    let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene
    if fullscreen {
        if #available(iOS 16.0, *) {
            windowScene?.requestGeometryUpdate(.iOS(interfaceOrientations: .landscape))
        } else {
            // Fallback on earlier versions
        }
    } else {
        if #available(iOS 16.0, *) {
            windowScene?.requestGeometryUpdate(.iOS(interfaceOrientations: .portrait))
        } else {
            // Fallback on earlier versions
        }
    }

    playerView?.willRotate()
}

```

This method only works for iOS 16 and above.  
For iOS 15 and below, you can try to replace `// Fallback on earlier versions` with what the following post suggests.

> <https://stackoverflow.com/questions/50386875/change-orientation-programmatically-with-button-ios/50387102#50387102>
