title: Why is there no universal base class in Swift?
body: <p>The documentation says</p>
  
  <blockquote>
    <p>NOTE</p>
    
    <p>Swift classes do not inherit from a universal base class. Classes you
    define without specifying a superclass automatically become base
    classes for you to build upon.”</p>
    
    <p>Excerpt From: Apple Inc. “<a href="https://itun.es/at/jEUH0.l" rel="noreferrer">The Swift Programming Language.</a>” iBooks.</p>
  </blockquote>
  
  <p>It doesn't make much sense to me. There is a reason why Objective-C has a universal base class, and the same reason should apply to Swift, does it? <code>NSObject</code> manages retain/release semantics, a default implementation for <code>isEqual:</code>, <code>hash</code> and <code>description</code>. All this functionality is available in Swift too.</p>
  
  <p>(Objective-C and Swift use the same runtime...)</p>
  
  <p>So, what's up with that? Are Swift classes with no defined superclasses just <code>NSObject</code>s that pose as proper root classes under the hood? Or is the default object-behaviour duplicated for each new root-class? Or have they created another Swift-baseclass? The implementation of <code>retain</code> and <code>release</code> is really complex, because it needs to take multithreading and weak references into account at the same time.</p>
  
  <p>Is there maybe a universal base class in Swift (despite what the documentation says)? It would be really handy, because in Objective-C I can e.g. write extensions that let me coalesce method invocations to the main runloop like <code>[obj.eventually updateCounter]</code> which can be read as "call <code>-updateCounter</code> the next time the main runloop gets in control. If, in the meantime, I call this method again, it should be called only once anyways. With this extension one could implement <code>-[UIView setNeedsDisplay]</code> as <code>[self.eventually display];</code> This is no longer possible in Swift if there is no universal base class (or maybe it is, who knows?)</p>