In my app I'm opening a pdf using QLPreviewController, which usually appears with a right thumbnail bar in iOS 10. But when I run the app on iOS 11, the thumbnail bar disappeared. I'm using the following code to preview the pdf.
#import <QuickLook/QuickLook.h>
-(void)viewDidLoad
{
if ([QLPreviewController canPreviewItem:[[NSBundle mainBundle] URLForResource:@"alice" withExtension:@"pdf"]])
{
QLPreviewController *previewController = [[QLPreviewController alloc] init];
previewController.dataSource = self;
[previewController.view setFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width/1.2, self.view.frame.size.height)];
[self addChildViewController:previewController];
[viewQuickLook addSubview:previewController.view];
[previewController didMoveToParentViewController:self];
}
}
-(NSInteger) numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller
{
return 1;
}
- (id <QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index
{
NSURL *pdfURL = [[NSBundle mainBundle] URLForResource:@"alice" withExtension:@"pdf"];
return pdfURL;
}
Is it natural in iOS 11?
Also I set my pdf preview screen width to 80%. But the pdf is not fitting to the screen and the content became horizontally scrollable. Any help will be appreciable.