If you want to get down to the bare metal and write your UI directly, then you'll likely want to start by learning Metal, which will allow you to interface with the machine's graphics card to do some drawing to the screen. (I suggest using a framework instead of attempting to work with the hardware directly, to save yourself a bunch of time.)
Start small, by learning how to get the graphics card to display a single pixel, then some lines, then more complex shapes. Learn how to draw in various colors, and fill shapes. Maybe how to draw some gradients. Once you've done all of that, you'll have most of the basic pieces you'll need to draw a good chunk of your UI.
The next really hard part is drawing text, which you'll need to steep yourself into a bit. I'll save a bit of the description here, but you can read up on some of the challenges. You'll need to learn how to draw read font data, render glyphs, shape text, do subpixel aliasing if relevant, etc.
Once you've got all that done, you're ready to make the UI actually interactive. Using something like DriverKit (again, just to abstract away having to deal with the bare hardware itself, which is a massive pain), you'll need to build up an event loop to start accepting mouse and keyboard input. You can then start reading mouse clicks, keyboard key presses, and more.
With all of that in place, you've got a lot of the tools in place to write your UI from the bottom up. And oh, don't forget to make it actually look pretty, unlike some older UI libraries.
Or, you can use AppKit/UIKit/SwiftUI, which built on all of the ideas that our parents and grandparents worked on so that we're the grandchildren who get to benefit. There's nothing wrong with that.
Swift is plenty capable — it can do all of these things and more. As could Objective-C, C, C++, Rust, <whatever>, you name it. But the key is that very few languages actually come with some form of UI machinery attached. If you ask "how do pop up a UI in C?", the answer is usually "well, do you want to use Qt, or wxWidgets, or fltk, or ...". Just because you can do something in "pure C", or "pure Swift", or "pure ...", doesn't mean it makes a lot of sense to.
And as for discussion about SwiftUI being off-topic for these forums…
As others have mentioned, it's off-topic because this is a space for talking about the open-source components of Swift and its development. SwiftUI is an Apple-specific, closed-source UI library that is one of several. It's also off-topic to discuss AppKit and UIKit for similar reasons. If Swift did include an open-source UI library as part of the language, it's very likely that it would be on-topic to discuss here.