I\'m using the below code to use QLPreviewcontroller to show some documents in my app,
let ql = QLPreviewController()
ql.dataSource = self
//ql.navigationIte
Swift 5 Solution:
Subclass QLPreviewController:
final class CustomQLPreviewController: QLPreviewController {
override func viewDidLoad() {
super.viewDidLoad()
navigationItem.rightBarButtonItem = UIBarButtonItem()
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
(children[0] as? UINavigationController)?.setToolbarHidden(true, animated: false)
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
(children[0] as? UINavigationController)?.setToolbarHidden(true, animated: false)
}
}
then present this subclass where you want like this:
let previewController = QLVideoController()
present(controller, animated: true, completion: nil)