Closed LieutenantKernel closed 8 years ago
I figured it out. You have to subclass QLPreviewController
and then disable it in the viewDidLoad
, viewDidAppear
, and viewWillAppear
. Then you must replace the superclass instances of the QLPreviewController
with the subclass.
this work for me
class QLSPreviewController : QLPreviewController {
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(true )
//This hides the share item
if let add = self.childViewControllers.first as? UINavigationController {
if let layoutContainerView = add.view.subviews[1] as? UINavigationBar {
layoutContainerView.subviews[2].subviews[1].isHidden = true
}
}
}
}
I am using layoutContainerView.subviews[1].subviews[1].isHidden = true
then its works for me.
Probably a newbie question but I'm having a hard time getting rid of the rightBarButtonItem entirely. Any help would be much appreciated!