In SwiftUI everything is made from Views, from the main container that is presented to the app's window, to text, a button, or even a toggle.
Thinking back to how UIKit works, this theory isn't too dissimilar—most objects are a subclass of UIView().
The only fundamental difference is that with SwiftUI, the layout and construction of all this is much more visible; this is the declarative syntax coming into play. The best way to think about declarative syntax is in a functional and logical way.
I want to vertically align items on my view:
VStack {}
I then want to add a Text box:
Text("Swift Cookbook")
Then, let's add a button:
Button(action: {
print("Set Action Here...")
}, label: {
Text("I'm going to perform an action")
})
Even the construction of the button is declarative itself: set an action; set a label. Everything is just... functional.
Another way to think of this would be similar to...