Programming in Swift: Functions and Types, Episode 40: Initializers | Kodeco

Learn how to create your own class initializers, including two-phase initialization, and required vs. convenience initializers.


This is a companion discussion topic for the original entry at https://www.kodeco.com/5429279-programming-in-swift-functions-and-types/lessons/40

During 10:35 you mentioned that the line self.init(firstName: transfer.firstName, lastName: transfer.lastName) actually calls required convenience init(firstName: String, lastName: String) in StudentAthlete because of polymorphism. May I ask if it is a compile-time polymorphism or a run-time polymorphism in this case? Could you maybe be a little more detailed about this part? Thank you very much!