Update: Apple responded to my Radar that a new property, PDFView.pageShadowsEnabled, has been added to iOS 12, beta 3. This is now the right way to hide the shadow. Hooray!
https://developer.apple.com/documentation/pdfkit/pdfview/3013838-pageshadowsenabled?changes=latest_minor
Pre-iOS 12 info below:
I confirmed with Apple (WWDC 2018 lab) there is no official way to hide the shadow. I was told there's an internal-only method to do this, and asked to file a Radar to expose that method. Radar # 40847614 if anyone wants to dupe.
Meanwhile I'm deep-diving the view hierarchy, and clipping everything to bounds. I don't like it, but it seems to work. The shadow returns on rotation, so I call this both in viewWillAppear and viewWillTransitionToSize.
-(void)removeShadowFromPDFView:(UIView *)view {
//Deep-dive into pdfView and set all views to clipsToBounds = YES
view.clipsToBounds = YES;
if ([view subviews].count == 0) {
//No subviews to examine
return;
}
for (UIView *subview in view.subviews) {
view.clipsToBounds = YES;
[self removeShadowFromView:subview];
}
}