Understanding SwiftUI structures
SwiftUI gives us views, controls, modifiers, and layout structures for declaring the user interface. The framework also includes event handlers for providing taps, gestures, and other kinds of input for our app, as well as tools for managing the flow of data coming from your app’s models.
But what’s a model? A model is simply a folder we create in the Project Navigator window where we usually keep the app’s data; for example, if we are working on a weather app, we can keep our wind, temperature, precipitation, and snow accumulation data in the app’s model after it has been received from the internet through an Application Programming Interface (API) call, which is prebuilt software that talks to other programs for us. That data will then be processed and sent down to the views and controls that the user will see and can interact with.
SwiftUI allows us to avoid using Interface Builder and Storyboards to design the...