Bringing everything together in ContentView
Okay – we have accomplished a lot, including creating files for single and double gears, a worm gear, a gearshift, and a fan. Now, let’s create the final file for the motor and organize all these files together in ContentView
.
We’re going to use a Swift feature called Pragma Marks; this is a special syntax that labels and delineates blocks of code with a very thin line between them and makes those labels appear in one drop-down menu for easy searching and navigation. That’s very helpful when you have very large files with hundreds or thousands of lines of code.
We will also use a SwiftUI feature called Groups; this can help us further organize all the code in the ContentView
file by grouping multiple objects together, such as views, scenes, or even commands, into a single unit. We will organize much of the code into groups based on whether it is animated on the x-, y-, or z-axis.
And then we will use...