2 Commits

Author SHA1 Message Date
Bas Broek 172dfc60eb Move modal logic to contained VC 2019-04-01 23:18:10 +02:00
Bas Broek 3c40c29561 Add modal information for accessibility 2019-04-01 23:09:09 +02:00
2 changed files with 22 additions and 2 deletions
@@ -13,7 +13,7 @@ class ClippedContainerViewController: UIViewController {
let viewController: UIViewController
private let options: ContextMenu.Options
private let containedViewController: UINavigationController
private let containedViewController: ModalNavigationViewController
override var preferredStatusBarStyle: UIStatusBarStyle {
return viewController.preferredStatusBarStyle
@@ -22,7 +22,7 @@ class ClippedContainerViewController: UIViewController {
init(options: ContextMenu.Options, viewController: UIViewController) {
self.viewController = viewController
self.options = options
self.containedViewController = UINavigationController(rootViewController: viewController)
self.containedViewController = ModalNavigationViewController(rootViewController: viewController)
super.init(nibName: nil, bundle: nil)
self.containedViewController.delegate = self
}
+20
View File
@@ -0,0 +1,20 @@
//
// ModalNavigationViewController.swift
// ContextMenu
//
// Created by Bas Broek on 01/04/2019.
//
import UIKit
class ModalNavigationViewController: UINavigationController {
override var accessibilityViewIsModal: Bool {
get { return true }
set {}
}
override func accessibilityPerformEscape() -> Bool {
dismiss(animated: UIAccessibility.isReduceMotionEnabled == false)
return true
}
}