Does anyone know how to remove the shadow and page number for a pdf document presented in UIWebView
?
I've found methods for non-Swift, but nothing for Swift.
Any help would be greatly appreciated.
UPDATE
I've found a Objective C method:
for (UIView* subView in [webView subviews])
{
if ([subView isKindOfClass:[UIScrollView class]]) {
for (UIView* shadowView in [subView subviews])
{
if ([shadowView isKindOfClass:[UIImageView class]]) {
[shadowView setHidden:YES];
}
}
}
}
Can anyone point me in the direction of a Swift method, or how to convert this to Swift. I have tried but getting nowhere I'm afraid.
Thanks in advance
Try this great answer:
func webViewDidFinishLoad(_ webView: UIWebView) {
for shadowView in self.webView.scrollView.subviews {
if !shadowView.isKind(of: UIImageView.self) {
shadowView.subviews[0].layer.shadowColor = UIColor.clear.cgColor
} else {
shadowView.layer.shadowColor = UIColor.clear.cgColor
}
}
}
Don't forget to set your ViewController as the delegate of the webView