[swift-evolution] Final by default for classes and methods

Kevin Lundberg kevin at klundberg.com
Mon Dec 7 13:38:03 CST 2015


> 
> Was subclassing always necessary for extending this functionality? Could you accomplish the same using extensions?
> 

It's been a long time since that example so I don't remember every specific detail, but I recall needing to override one specific method that another class outside of my control called in order to intercept some behavior to tweak it slightly. I don't think extensions would have helped there unless I could have also swizzled my method with the original to keep the original's behavior as well (and I presume we don't want to introduce method swizzling as a first-class swift runtime feature).


More information about the swift-evolution mailing list