 }
 
 extension ModallyPresentable where Self: UIViewController {
-    public var addCancelButtonWhenModallyPresented: Bool {
-        return true
+    /// Returns a bar button item that dismisses `self`.
+    public func dismissBarButtonItem() -> UIBarButtonItem {
+        return UIBarButtonItem(barButtonSystemItem: .cancel).apply {
+            $0.accessibilityIdentifier = "dismissButton"
+            $0.addAction { [weak self] _ in
+                self?.dismiss(animated: true)
+            }
+        }
     }
 
     /// Presents a view controller modally.

            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)
            }
        }
    }
}

            return
        }

        navigationItem.leftBarButtonItem = dismissBarButtonItem()

        let NavigationController = navigationControllerClassWhenModallyPresented

