From 6a8071ce152105ba8bc484dbf05f0198468c743b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Fri, 3 Mar 2023 13:12:33 +0100 Subject: [PATCH 1/3] Preset development team --- TestApp/Integrations/Carthage/project+lcp.yml | 1 + TestApp/Integrations/Carthage/project.yml | 1 + TestApp/Integrations/CocoaPods/project+lcp.yml | 1 + TestApp/Integrations/CocoaPods/project.yml | 2 ++ TestApp/Integrations/Local/project+lcp.yml | 1 + TestApp/Integrations/Local/project.yml | 2 ++ TestApp/Integrations/SPM/project+lcp.yml | 1 + TestApp/Integrations/SPM/project.yml | 2 ++ 8 files changed, 11 insertions(+) diff --git a/TestApp/Integrations/Carthage/project+lcp.yml b/TestApp/Integrations/Carthage/project+lcp.yml index b97e6e0c9..2d53bca00 100644 --- a/TestApp/Integrations/Carthage/project+lcp.yml +++ b/TestApp/Integrations/Carthage/project+lcp.yml @@ -39,4 +39,5 @@ targets: settings: LIBRARY_SEARCH_PATHS: $(PROJECT_DIR)/Carthage OTHER_SWIFT_FLAGS: -DLCP + DEVELOPMENT_TEAM: ${RD_DEVELOPMENT_TEAM} diff --git a/TestApp/Integrations/Carthage/project.yml b/TestApp/Integrations/Carthage/project.yml index ea1b7dc4d..b21f2aac9 100644 --- a/TestApp/Integrations/Carthage/project.yml +++ b/TestApp/Integrations/Carthage/project.yml @@ -34,4 +34,5 @@ targets: - package: MBProgressHUD settings: LIBRARY_SEARCH_PATHS: $(PROJECT_DIR)/Carthage + DEVELOPMENT_TEAM: ${RD_DEVELOPMENT_TEAM} diff --git a/TestApp/Integrations/CocoaPods/project+lcp.yml b/TestApp/Integrations/CocoaPods/project+lcp.yml index c24c922ca..fcfd322e7 100644 --- a/TestApp/Integrations/CocoaPods/project+lcp.yml +++ b/TestApp/Integrations/CocoaPods/project+lcp.yml @@ -10,3 +10,4 @@ targets: - path: Sources settings: OTHER_SWIFT_FLAGS: $(inherited) -DLCP + DEVELOPMENT_TEAM: ${RD_DEVELOPMENT_TEAM} diff --git a/TestApp/Integrations/CocoaPods/project.yml b/TestApp/Integrations/CocoaPods/project.yml index 405a83753..f733c481e 100644 --- a/TestApp/Integrations/CocoaPods/project.yml +++ b/TestApp/Integrations/CocoaPods/project.yml @@ -8,3 +8,5 @@ targets: deploymentTarget: "14.0" sources: - path: Sources + settings: + DEVELOPMENT_TEAM: ${RD_DEVELOPMENT_TEAM} diff --git a/TestApp/Integrations/Local/project+lcp.yml b/TestApp/Integrations/Local/project+lcp.yml index d75f2ec20..2f4df429d 100644 --- a/TestApp/Integrations/Local/project+lcp.yml +++ b/TestApp/Integrations/Local/project+lcp.yml @@ -44,4 +44,5 @@ targets: - package: SwiftSoup settings: OTHER_SWIFT_FLAGS: -DLCP + DEVELOPMENT_TEAM: ${RD_DEVELOPMENT_TEAM} diff --git a/TestApp/Integrations/Local/project.yml b/TestApp/Integrations/Local/project.yml index 9c240d610..8de36502a 100644 --- a/TestApp/Integrations/Local/project.yml +++ b/TestApp/Integrations/Local/project.yml @@ -36,4 +36,6 @@ targets: - package: Kingfisher - package: MBProgressHUD - package: SwiftSoup + settings: + DEVELOPMENT_TEAM: ${RD_DEVELOPMENT_TEAM} diff --git a/TestApp/Integrations/SPM/project+lcp.yml b/TestApp/Integrations/SPM/project+lcp.yml index 97857e1f5..9ccb84128 100644 --- a/TestApp/Integrations/SPM/project+lcp.yml +++ b/TestApp/Integrations/SPM/project+lcp.yml @@ -45,3 +45,4 @@ targets: - package: SwiftSoup settings: OTHER_SWIFT_FLAGS: -DLCP + DEVELOPMENT_TEAM: ${RD_DEVELOPMENT_TEAM} diff --git a/TestApp/Integrations/SPM/project.yml b/TestApp/Integrations/SPM/project.yml index 4813ead1d..79cb3cec9 100644 --- a/TestApp/Integrations/SPM/project.yml +++ b/TestApp/Integrations/SPM/project.yml @@ -36,4 +36,6 @@ targets: - package: GRDB - package: Kingfisher - package: MBProgressHUD + settings: + DEVELOPMENT_TEAM: ${RD_DEVELOPMENT_TEAM} From f20822afdc27c27d866e401fe87bfd65b4b5f082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Fri, 3 Mar 2023 13:18:05 +0100 Subject: [PATCH 2/3] Enable window resizing on M1 --- TestApp/Sources/Info.plist | 2 +- TestApp/Sources/Library/LibraryViewController.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TestApp/Sources/Info.plist b/TestApp/Sources/Info.plist index 299ee3d5d..f63d3704b 100644 --- a/TestApp/Sources/Info.plist +++ b/TestApp/Sources/Info.plist @@ -213,7 +213,7 @@ armv7 UIRequiresFullScreen - + UISupportedInterfaceOrientations UIInterfaceOrientationPortrait diff --git a/TestApp/Sources/Library/LibraryViewController.swift b/TestApp/Sources/Library/LibraryViewController.swift index 6c56bfa5b..07fd899f0 100644 --- a/TestApp/Sources/Library/LibraryViewController.swift +++ b/TestApp/Sources/Library/LibraryViewController.swift @@ -101,7 +101,7 @@ class LibraryViewController: UIViewController, Loggable { override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) - collectionView.collectionViewLayout.invalidateLayout() + collectionView?.collectionViewLayout.invalidateLayout() } static let iPadLayoutNumberPerRow:[ScreenOrientation: Int] = [.portrait: 4, .landscape: 5] From 91feee4c8a059c20650e705dbccc59069fb71c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Fri, 3 Mar 2023 14:19:41 +0100 Subject: [PATCH 3/3] Fix EPUB tap event sent twice when using a mouse --- CHANGELOG.md | 1 + Sources/Navigator/EPUB/EPUBSpreadView.swift | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 315459f47..956acaf01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ All notable changes to this project will be documented in this file. Take a look * Fixed a race condition issue with the `AVTTSEngine`, when pausing utterances. * Fixed crash with `PublicationSpeechSynthesizer`, when the currently played word cannot be resolved. +* Fixed EPUB tap event sent twice when using a mouse (e.g. on Apple Silicon or with a mouse on an iPad). ## [2.4.0] diff --git a/Sources/Navigator/EPUB/EPUBSpreadView.swift b/Sources/Navigator/EPUB/EPUBSpreadView.swift index 629fe3707..01984c589 100644 --- a/Sources/Navigator/EPUB/EPUBSpreadView.swift +++ b/Sources/Navigator/EPUB/EPUBSpreadView.swift @@ -93,7 +93,9 @@ class EPUBSpreadView: UIView, Loggable, PageView { addSubview(webView) setupWebView() - addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(didTapBackground))) + let gestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapBackground)) + gestureRecognizer.delegate = self + addGestureRecognizer(gestureRecognizer) for script in scripts { webView.configuration.userContentController.addUserScript(script) @@ -514,6 +516,14 @@ extension EPUBSpreadView: WKUIDelegate { } } +extension EPUBSpreadView: UIGestureRecognizerDelegate { + func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool { + // Prevents the tap event from being triggered by the fallback tap + // gesture recognizer when it is also recognized by the web view. + true + } +} + private extension EPUBSpreadView { func updateActivityIndicator() {