22. A SwiftUI Example Tutorial
Now that many of the fundamentals of SwiftUI development have been covered, this chapter will begin to put this theory into practice through the design and implementation of an example SwiftUI based project.
The objective of this chapter is to demonstrate the use of Xcode to design a simple interactive user interface, making use of views, modifiers, state variables and some basic animation techniques. Throughout the course of this tutorial a variety of different techniques will be used to add and modify views. While this may appear to be inconsistent, the objective is to gain familiarity with the different options available.
22.1 Creating the Example Project
Start Xcode and select the option to create a new project. On the template selection screen, make sure iOS is selected and choose the Single View App option before proceeding to the next screen as shown in Figure 22-1 below:
On the project options screen, name the project SwiftUIDemo and...