It seems that iOS 10 has changed the way QLPreviewController is QLPreviewController . On iOS 9, when I view the image, introducing the QLPreviewController mod, I see a good zoom effect, and the initial preview state is with a black background and hidden navigation and a toolbar. I can click on the image to make the stripes visible (which changes the background to white). Pressing again switches the state.
In iOS 10, the same code results in a white background image, and the zoom animation is incorrect (it seems to be displayed at the bottom of the screen).
I found that implementing this practically undocumented new data source method for iOS 10 fixed the problem:
- (UIView* _Nullable)previewController:(QLPreviewController *)controller transitionViewForPreviewItem:(id <QLPreviewItem>)item { return [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:MIDPhotoImageRowIndex_Image inSection:MIDPhotoSectionIndex_Image]]; }
The returned view is the same view that previewController:frameForPreviewItem:inSourceView: uses as a reference for the original content frame (that is, the image in my table cell).
The documentation for this delegate method at the time of writing is simply saying, "Browse is not available."
The implementation of this method meant that previewController:frameForPreviewItem:inSourceView: now called on iOS 10. I just want the default way to use the original black background without navigation bars.
Geoff hackworth
source share