Я работаю с QuickLook для просмотра файлов PDF.
Он работает правильно в iOS 7.1, но с iOS 8 GM возникают некоторые проблемы.
Картинки лучше слов, я хочу показать вам проблемы:
iOS 7.1 Xcode 6 (работает нормально)
Переход с QuickLook (без сбоев)
Прокрутка страницы, панель навигации хорошо скрывается
----------------------------------------------------------------------------- ---------------------------
А теперь iOS 8 GM с Xcode 6
Переход с QuickLook...
Прокрутка страницы, панель навигации не скрывается, индикатор страницы скрывается за панелью навигации
Та же проблема с симулятором iPhone, симулятором iPad, устройством iPhone и устройством iPad.
Вы можете увидеть здесь мой исходный код:
- (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)previewController
{
NSInteger numToPreview = 0;
if (currentSection == CVSectionConvocations)
numToPreview = self.convocation.convocations.count;
else if (currentSection == CVSectionAttachments)
numToPreview = self.convocation.attachements.count;
return numToPreview;
}
- (id)previewController:(QLPreviewController *)previewController previewItemAtIndex:(NSInteger)idx
{
PDF *pdf;
if (currentSection == CVSectionConvocations)
pdf = self.convocation.convocations[idx];
else if (currentSection == CVSectionAttachments)
pdf = self.convocation.attachements[idx];
return [pdf path];
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
// determine section
currentSection = (indexPath.section == 0 ? CVSectionConvocations : CVSectionAttachments);
PDF *pdf;
if (currentSection == CVSectionConvocations)
pdf = self.convocation.convocations[indexPath.row];
else if (currentSection == CVSectionAttachments)
pdf = self.convocation.attachements[indexPath.row];
if ([pdf isStored]) {
QLPreviewController *previewController = [[QLPreviewController alloc] init];
previewController.dataSource = self;
previewController.delegate = self;
previewController.currentPreviewItemIndex = indexPath.row;
[[self navigationController] pushViewController:previewController animated:YES];
} else {
[self displayMessage:@"Document not found" title:@"Oups !"];
}
}
Спасибо за вашу помощь ;)