What problems is Swift trying to prevent by observing this?
This is a great question, and Objective-C did not avoid it.
The problem is that, being inside the initialization method, the object is technically in a partially constructed state. The Bryan post is a great (albeit far-fetched) example of why. A common problem is that if the super class initializer calls the method, the subclass can override this method. This in itself is not bad. The problem arises if the overridden method assumes that the object is completely constructed.
However, since the object is still in the middle of the initializer call, this is not the case. The whole object is not built until a call [super init] is returned and the class of the object executes some of its initialization code.
There is a related problem with dealloc methods: if you call methods inside your -dealloc method, these methods may assume that the object is completely built, but in fact it can be partially deconstructed. This is not much for a deal in ARC, but it can still lead to some very subtle errors.
With Swift, it was decided to avoid this class of problems by observing this rule:
By the time you decide to call super , the calling class must complete any initialization of the class.
A variation of this rule:
You cannot call methods until you call the super initializer.
With this rule, you will never encounter the problem described above.
source share