             presentingViewController?.present(nvc, animated: true)
         }
     }
-
-    /// Returns a bar button item that dismisses `self`.
-    private func cancelButtonItem() -> UIBarButtonItem {
-        return UIBarButtonItem(barButtonSystemItem: .cancel).apply {
-            $0.accessibilityIdentifier = "dismissButton"
-            $0.addAction { [weak self] _ in
-                self?.dismiss(animated: true)
-            }
-        }
-    }
 }

}

extension ModallyPresentable where Self: UIViewController {
    public var addCancelButtonWhenModallyPresented: Bool {
        return true
    }

    /// Presents a view controller modally.

            return
        }

        navigationItem.leftBarButtonItem = dismissBarButtonItem()

        let NavigationController = navigationControllerClassWhenModallyPresented

