-2

I'm working on a SwiftUI app for VisionOS and I want to add a menu to the left side of the app's interface. The menu should contain some items that the user can interact with.

I tried using SwiftUI's NavigationView to achieve this, but it doesn't seem to work as expected in VisionOS. The menu doesn't show up on the left side, and I'm having trouble navigating between different scenes.

This is the goal here:

enter image description here

Maybe TabView is used here?

János
  • 32,867
  • 38
  • 193
  • 353

1 Answers1

0

You can use Tab bars.

Two important things you should know:

  1. In general, use up to five tabs in iOS and up to six in visionOS, iPadOS, and tvOS.
  2. In visionOS, a tab bar is always vertical, floating in a position that’s fixed relative to the window’s leading side. When people look at a tab bar, it automatically expands; to open a specific tab, people focus the tab and tap. While a tab bar is expanded, it can temporarily obscure the content behind it.

More details in this link: https://developer.apple.com/design/human-interface-guidelines/tab-bars

enter image description here

baohoang
  • 616
  • 1
  • 5
  • 13
  • hey, thanks, would you look at this: https://stackoverflow.com/questions/76812309/swiftui-tabview-not-consistently-placing-tab-bar-on-left-side-in-visionos-simula – János Aug 01 '23 at 13:50
  • Thank you for sharing the link @János, and its more details. I'm waiting for an answer to that post. – baohoang Aug 02 '23 at 01:18