Fix stretchy menu interaction not working on iPad

This commit is contained in:
Shadowfacts 2022-06-20 11:26:05 -04:00
parent 1e7e8b7f85
commit 168c5abbcf
2 changed files with 4 additions and 2 deletions

View File

@ -77,11 +77,14 @@ class ReadViewController: UIViewController {
if let content = itemContentHTML() {
webView.loadHTMLString(content, baseURL: item.url)
}
webView.scrollView.alwaysBounceVertical = true
webView.scrollView.alwaysBounceHorizontal = false
view.addSubview(webView)
NSLayoutConstraint.activate([
webView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
webView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
// subtract 0.5, because otherwise, on ipad, the web view's scroll content view ends up being wider than the scroll view itself, causing the content to bounce horizontally
webView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -0.5),
webView.topAnchor.constraint(equalTo: view.topAnchor),
webView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
])

View File

@ -56,7 +56,6 @@ class StretchyMenuInteraction: NSObject, UIInteraction {
panRecognizer.delegate = self
panRecognizer.allowedScrollTypesMask = [.continuous]
view.addGestureRecognizer(panRecognizer)
}
private var prevTranslation: CGFloat = 0