0

In my app I want a video to open in landscape mode when the MediaPlayer is being opened, but I don't want to enable landscape in all other ViewControllers. How can I programmatically achieve this using Swift?

nhgrif
  • 61,578
  • 25
  • 134
  • 173
GLS
  • 831
  • 6
  • 8

1 Answers1

0

You need to declare method viewWillTransitionToSize:withTransitionCoordinator: in your view controller, and change frame relatively to your needs. In more detail, you need to read here, at least.

itsji10dra
  • 4,603
  • 3
  • 39
  • 59
dimpiax
  • 12,093
  • 5
  • 62
  • 45