1

Action/Options menu is not visible in the first launch, it appears when I go to full screen mode and come back to normal mode. Attached screenshots for reference. What am I doing wrong? Here is the code:

let docController = UIDocumentInteractionController(url: url!)
docController.delegate = self
docController.presentPreview(animated: true)

and the delegate method:

override func documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -> UIViewController {
        return self.navigationController!
}

and is there a way that I can change the bottom bar color (which holds the Action/Options menu button) to black?Without menu icon first launch With menu icon after full screen mode

Dee
  • 1,887
  • 19
  • 47

2 Answers2

0

try this, it works for me

let docPrev:UIDocumentInteractionController = UIDocumentInteractionController.init(url: url!)
docPrev.delegate = self
docPrev.presentPreview(animated: true)

Delegate method:

func documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -> UIViewController {
    return self
}
Patel Jigar
  • 2,141
  • 1
  • 23
  • 30
0

Please visit below link: Opening a file by UIDocumentInteractionController

Answer on above link suggests that in delegate method you need to return “self”. This is same as mentioned by Jigar. Also above link suggested below link which may helpful to you

https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/PreviewingandOpeningItems.html

Community
  • 1
  • 1
Premal
  • 551
  • 1
  • 6
  • 25