Juliet C. answered 08/02/20
Multiple semesters of teaching Swift in iOS app development courses
Only classes have inheritance in Swift; structs do not have inheritance. For a subclass to override a method inherited from its superclass, it must use the override keyword before the func keyword when defining the method. When the override keyword is used, the Swift compiler checks that a matching method exists in the superclass (whether defined in, or inherited by, the superclass). If the method does not exist in the superclass, the compiler will report an error. If a method is defined in a subclass without the override keyword but it matches a method in the superclass, the compiler will report an error.