This code is legal in Swift:
class Snapper : NSObject {
var anim : UIDynamicAnimator
init(referenceView:UIView) {
self.anim = UIDynamicAnimat
It's not an answer of the why but adding a symbolic breakpoint on [NSObject init]
shows that it gets called even if super.init()
is commented out.
It definitely seems a special case as replacing NSObject
with any other class makes the compiler warn again about the missing super call. My guess is the the compiler handles this as a special case given that it's our base class with just one known designated initializer.