[swift-evolution] Add code to super methods.

Tino Heth 2th at gmx.de
Tue Nov 29 03:48:57 CST 2016


> Methods that need to be called when they are overridden are
> almost always a result of poor design.
Without an explanation or data to back this statement, it's hard to argue about it, and I won't make random shots. 

But as a matter of fact, we have to deal with methods which require the behaviour in question now, and I have no idea when Cocoa will be replaced with something better.

Just out of sheer curiosity:
What would be a better design for a method like viewWillAppear? The obvious alternative that is possible with current Swift and template methods looks really ugly to me:
Not only would you have to add two empty methods to each subclass of UIViewController, but also rely on that those methods are only overridden once in the hierarchy of inheritance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161129/c479b80d/attachment.html>


More information about the swift-evolution mailing list