# SwiftUI equivalent of DesktopPagePanel

**URL:** <https://ifnotnil.com/t/swiftui-equivalent-of-desktoppagepanel/4408>\
**Category:** Swift\
**Created:** [24 July 2025 00:13 UTC](https://ifnotnil.com/t/swiftui-equivalent-of-desktoppagepanel/4408 "2025-07-24T00:13:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andyb](https://ifnotnil.com/letter_avatar_proxy/v4/letter/a/96bed5/32.png) [@andyb](https://ifnotnil.com/u/andyb)\
**Post date:** [24 July 2025 00:13 UTC](https://ifnotnil.com/t/swiftui-equivalent-of-desktoppagepanel/4408/1 "2025-07-24T00:13:29Z")

</div>

Howdy. Another Xojo refugee here 😉

I actually decided to move away from Xojo back when WWDC25 came out. Xojo is already behind in the UI department when it comes to OS updates, and it seemed obvious to me they were never going to catch up now.

Anywho… I’ve been devouring Swift & SwiftUI books since then and so far it is going well (my original dev experience is C#). I’m focusing first on macOS apps and want to start building some proof of concept apps first. I did a lot of apps in Xojo utilizing the DesktopPagePanel and dynamic containers, which work well for what it is.

I realize I need to change my design thinking when it comes to SwiftUI or Storyboard apps, but is there a View element in SwiftUI (for macOS) that mimics the functionality of the `DesktopPagePanel`?

I think it might be `NavigationStack`, but I’m finding very few examples of this (that are not iOS related). Or do I just need to keep exploring `NavigationSplitView`?

It sure would be helpful if there was a visual guide to all the various SwiftUI views.

Thanks. Cheers!

---

<div class="post-metadata">

**Author:** ![samRowlands](https://ifnotnil.com/user_avatar/ifnotnil.com/samrowlands/32/121_2.png) [@samRowlands](https://ifnotnil.com/u/samRowlands)\
**Post date:** [24 July 2025 01:40 UTC](https://ifnotnil.com/t/swiftui-equivalent-of-desktoppagepanel/4408/2 "2025-07-24T01:40:02Z")

</div>

Because SwiftUI is declarative rather than a visual builder you can use an if statement or a switch statement to show and hide views like a Xojo PagePanel.

```auto
   switch currentPage {
   case 1:
        // page 1
   default:
        // page 0
   }

```

I made some SwiftUI articles available from our site [SwiftUI Development - Ohanaware.com](https://ohanaware.com/swift/)

---

<div class="post-metadata">

**Author:** ![DaveS](https://ifnotnil.com/user_avatar/ifnotnil.com/daves/32/79_2.png) [@DaveS](https://ifnotnil.com/u/DaveS)\
**Post date:** [24 July 2025 04:48 UTC](https://ifnotnil.com/t/swiftui-equivalent-of-desktoppagepanel/4408/3 "2025-07-24T04:48:22Z")

</div>

`open class ux$BASEPANEL : NSTabView,NSTabViewDelegate`

this is the declaration for the base class I use for

`open class uxPAGEPANEL : ux$BASEPANEL {`

and

`open class uxTABPANEL : ux$BASEPANEL {`

also check out this topic I posted here a while back

> [@Swift - adding controls to a TabPanel](https://ifnotnil.com/t/swift-adding-controls-to-a-tabpanel/2344):
>
> I have dozens of subclassed controls class C1 : NSView { vareventDelegate : myDelegate ... other stuff ... } class S1 : NSSlider { var eventDelegate : myDelegate ... other stuff ... } Adding these to the base window works fine using a method like this public func addToView(\_ parent:NSView?) { parent!.addSubview(self) self.eventDelegate = parent!.window as? dsCONTROLDELEGATE } HOWEVER adding them to a TabPanel/Pagepanel is more difficult adding the control itself is easy class myTab …
