From 648cca2b75c9a900fbaa2546e43303249e337248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Fri, 9 Sep 2022 14:32:19 +0200 Subject: [PATCH] Fix vertically bouncing EPUB resources in iOS 16 --- CHANGELOG.md | 1 + Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 225262f78..2784a9af2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ All notable changes to this project will be documented in this file. Take a look * [#61](https://github.com/readium/swift-toolkit/issues/61) Fixed serving EPUB resources when the HREF contains an anchor or query parameters. * Performance issue with EPUB fixed-layout when spreads are enabled. * Disable scrolling in EPUB fixed-layout resources, in case the viewport is incorrectly set. +* Fix vertically bouncing EPUB resources in iOS 16. #### Streamer diff --git a/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift b/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift index 29f829e48..10ea245d4 100644 --- a/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift +++ b/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift @@ -35,7 +35,13 @@ final class EPUBReflowableSpreadView: EPUBSpreadView { override func setupWebView() { super.setupWebView() + scrollView.bounces = false + // Since iOS 16, the default value of alwaysBounceX seems to be true + // for web views. + scrollView.alwaysBounceVertical = false + scrollView.alwaysBounceHorizontal = false + scrollView.isPagingEnabled = !isScrollEnabled webView.translatesAutoresizingMaskIntoConstraints = false