0

The orientation of my IOS app has been locked to Portrait mode. However, I want to support both landscape and portrait orientation for files that open using UIDocumentInteractionController. Here is my code to open a file url.

 let url = URL.init(fileURLWithPath: fileURL)
        self.documentController = UIDocumentInteractionController.init(url: url)
        documentController!.delegate = self
        documentController!.presentPreview(animated: false)

How do I achieve portrait and landscape orientation for files that open using the above code while also locking down the orientation to portrait for other screens? Thanks so much!

Karu
  • 935
  • 2
  • 13
  • 32

1 Answers1

0

Override supportedInterfaceOrientations and shouldAutoRotate:

How to allow only single UIViewController to rotate in both Landscape and Portrait direction?. Swift 3 Kosher Version

Kevin
  • 483
  • 3
  • 11