7

I'm presenting a modal view controller in my Mac Catalyst / iOS app. iOS has the ability to swipe the modally presented view down to dismiss, or simply tap outside the presented view.

It would appear that mac catalyst has neither of these features. I understand that since it does not have a touch screen, the swipe gesture is not necessary, but I was hoping the tap outside the modally presented view would work. Is it supposed to?

What are people doing in mac catalyst to dismiss their modally present views? I'm not sure if it's important, but I am getting the following error when I present my modal view:

2022-07-05 10:00:19.975612-0500 TechHub[15235:105971] [WindowHosting] UIScene property of UINSSceneViewController was accessed before it was set.
2022-07-05 10:00:20.476770-0500 TechHub[15235:105971] Unbalanced calls to begin/end appearance transitions for <TechHub.PopoverNavigationController: 0x11d906800>.

Here is the code I'm using to preset the view controller:

let searchQuestionsNavController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "SearchQuestionsNavController") as! PopoverNavigationController
self.present(searchQuestionsNavController, animated: true) {
        
}

As you can see it's just a simple present function to show a view. Not sure why the error messages appear. There is no specified modal presentation style, but it appears default is choosing .pageSheet when I present the view.

Alex Ritter
  • 1,009
  • 3
  • 18
  • 40
  • Clicking outside to dismiss isn’t a user interaction you’d see in macOS apps. One must always provide a way to dismiss sheets, even on iOS for those who don’t know you can tap outside or swipe to dismiss and especially for those who use assistive technologies like VoiceOver. – Jordan H Jul 31 '22 at 00:56

0 Answers0