In Swift, enums provide a great power when dealing with custom data properties. We can create complex and nested types related to themselves by declaring associated types. enum Animal {
case dog(name: String, barkType: String)
case cat(name: String, meow: String)
case random(sound: String)
} Associated values and custom properties With associated values everything becomes even…