Understanding structures
Like classes, structures also group together properties and methods used to represent an object and do specific tasks. Remember the Animal class you created? You can also use a structure to accomplish the same thing. There are differences between classes and structures though, and you will learn more about those later.
Here's what a structure declaration and definition looks like:
struct StructName {
property1
property2
property3
method1() {
code
}
method2(){
code
}
}
As you can see, a structure is very similar to a class. It also has a descriptive name, can contain properties and methods, and you can create instances.
Important information
To learn more about structures, visit: https://docs.swift.org/swift-book/LanguageGuide/ClassesAndStructures...