title: swift: Equivalent objective-c runtime class
body: <p>What is equivalent swift code for below Objective-C code. I couldn't find swift topic with runtime concept.</p>
  
  <pre><code>#import &lt;objc/runtime.h&gt;    
  Class class = [self class];
  </code></pre>
  
  <p>Trying to get class object of <code>self</code>? </p>
  
  <p><strong>Update:</strong>
  Tried with below code, got error as <code>'UIViewController.type' doesn't conform to protocol 'AnyObject'</code></p>
  
  <pre><code>var klass: AnyClass = object_getClass(self)
  </code></pre>
  
  <p><strong>Note:</strong> Found <a href="https://stackoverflow.com/questions/24068942/swift-runtime-documentation">this post,</a> but wouldn't helped.</p>