I am subclassing QLPreviewController in my application and using the following code.
QLPreviewControllerSubClass* preview = [[QLPreviewControllerSubClass all
I'm dealing the same problem also.
I made the rightBarButton hidden, but may have some problem when the loading of pdf lasts for a long time.
Below is my process.
1.Make a sub class of QLPreviewController.
2.Add a timer to repeats setting the rightBarButton to nil when the class init.
_hideRightBarButtonTimmer = [NSTimer scheduledTimerWithTimeInterval:0.01
target:self
selector:@selector(hideRightButton)
userInfo:nil
repeats:YES];
3.Invalidate the timer in viewDidAppear.
[NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(cancelTimmer) userInfo:nil repeats:NO];
And I found the rightBarButton is setup while the loading of pdf file is finished. If we can detect the event the solution will be much easier and clearer.
Hopes it will be helpful.