Skip to content

Commit

Permalink
fix: close button is missing in modal on visionOS
Browse files Browse the repository at this point in the history
  • Loading branch information
rinsuki committed Feb 12, 2024
1 parent 2fc7c9a commit 5715321
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ class ModalNavigationViewController: UINavigationController {
init(rootViewController: UIViewController, asSceneRoot: Bool = false) {
self.asSceneRoot = asSceneRoot
super.init(rootViewController: rootViewController)
#if os(visionOS)
#else
rootViewController.navigationItem.leftBarButtonItem = .init(
barButtonSystemItem: .cancel,
target: self,
action: #selector(closeAsDecline)
)
#endif
if #available(iOS 17.0, *), traitCollection.userInterfaceIdiom == .vision, asSceneRoot {
} else {
rootViewController.navigationItem.leftBarButtonItem = .init(
barButtonSystemItem: .cancel,
target: self,
action: #selector(closeAsDecline)
)
}
}

@objc func closeAsDecline() {
Expand Down

0 comments on commit 5715321

Please sign in to comment.