I successfully subclassed a WKWwebView
in Swift. But now I also want to subclass the UIScrollView
within that WKWebView
. E.g. I'd like to do something like this (pseudo-code):
class CustomWKWebview : WKWebView {
override init(frame: CGRect, configuration: WKWebViewConfiguration) {
super.init(frame: frame, configuration: configuration)
self.scrollView = CustomScrollView // <-- this is what I want
}
}
Although this seems to be impossible since self.scrollView
is declared as read-only by Apple.
Is there another way to subclass the scrollView inside WKWebView anyway?