Rules of Swift Initializers


Rule 1: A designated initializer must call its immediate superclass designated initializer
Rule 2: A convenience initializer must calls initializers of the same class
Rule 3: A convenience initializers must ultimately call the designated initializer

Simple Case:















Complex Case

























Reference

No comments:

Post a Comment