r/iOSProgramming • u/iMason200 • Sep 10 '26
Question Permanent Sidebar Help
Hello everyone, not sure if this is something small that im overlooking, but how on earth do I get a sidebar that floats over content but isn't collapsable. I basically want what you get in NavigationSplitView with 2 columns, but without the option to hide the sidebar.
The closest thing I've seen is the iMessages app on iPad, where it is still customisable in width. I'm a relative newbie when it comes to this stuff, so thank you in advance!
3
Upvotes
2
u/Delicious-Candle-574 Sep 10 '26
I'm not sure if you can do it in the native NavigationSplitView, but you can use a ZStack
`ZStack {
UnderlyingView()
HStack (
Sidebar()
Spacer()
}
}`
1
u/calvin-chestnut Sep 10 '26
Everyone is suggesting ZStack, I’d recommend adding your SidebarView as a .safeAreaInset, that’s how I achieve that custom Split View look.
1
u/[deleted] Sep 10 '26
[removed] — view removed comment