Before starting to code our App we need to understand what is a View
.
Without going into details, a View
is an element that can be display on the screen. As we'll see in the following articles, the UI components Text
, Image
, or Button
are also views that we can use to create our App.
A view can be just a container of other views as well.
ContentView
As you can see, the file ContentView is actually a View
that will include other views, these are User Interface components or just UI components.
ContentView will be the first screen of our App.
Body
Every View
that we create (we'll see later how to do this), will include the element var body: some View
. So far, you only need to understand that every UI component that we want to add to our screen, will be placed inside the braces ({}
) of this body
.
var body: some View {
Text("Hello World")
}
Be the first to comment