Summary
We have now completed our elevator project. Let’s look at what we have done.
We used GeometryReader
and the proxy constant to add images to the project and position them where needed, which will resize all the images in the project dynamically, based on the device that displays them, whether iPhones or iPads.
We created DataModel
to store all the app’s data and functions, and we accessed all that data using the @
ObservableObject
protocol.
We used timers to trigger door and light animations at different moments in the scene, making the animations happen on their own. We also added and styled a button to change color, when pressed, and we made floor lights turn on and off with timers.
The skills learned here can be useful and applied to other projects. For example, if you were putting together a game app that has several levels, maybe you could incorporate an elevator scene into the game to take the user to another level after they have completed a certain...