UIPageViewControllerExtension.swift 633 B

1234567891011121314151617181920212223242526
  1. //
  2. // SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  3. // SPDX-License-Identifier: GPL-3.0-or-later
  4. //
  5. import UIKit
  6. extension UIPageViewController {
  7. // https://stackoverflow.com/a/47075283
  8. func enableSwipeGesture() {
  9. for view in self.view.subviews {
  10. if let subView = view as? UIScrollView {
  11. subView.isScrollEnabled = true
  12. }
  13. }
  14. }
  15. func disableSwipeGesture() {
  16. for view in self.view.subviews {
  17. if let subView = view as? UIScrollView {
  18. subView.isScrollEnabled = false
  19. }
  20. }
  21. }
  22. }