Since Swift supports method and initializer overloading, you can put multiple init
alongside each other and use whichever you deem convenient:
c
According to the Swift 2.1 documentation, convenience
initializers have to adhere to some specific rules:
A convenience
initializer can only call intializers in the same
class, not in super classes (only across, not up)
A convenience
initializer has to call a designated initializer
somewhere in the chain
A convenience
initializer cannot change ANY property before it
has called another initializer - whereas a designated initializer
has to initialize properties that are introduced by the current class
before calling another initializer.
By using the convenience
keyword, the Swift compiler knows that it has to check for these conditions - otherwise it couldn't.