title: How do I print the type or class of a variable in Swift?
body: <p>Is there a way to print the runtime type of a variable in swift? For example:</p>
  
  <pre><code>var now = NSDate()
  var soon = now.dateByAddingTimeInterval(5.0)
  
  println("\(now.dynamicType)") 
  // Prints "(Metatype)"
  
  println("\(now.dynamicType.description()")
  // Prints "__NSDate" since objective-c Class objects have a "description" selector
  
  println("\(soon.dynamicType.description()")
  // Compile-time error since ImplicitlyUnwrappedOptional&lt;NSDate&gt; has no "description" method
  </code></pre>
  
  <p>In the example above, I'm looking for a way to show that the variable "soon" is of type <code>ImplicitlyUnwrappedOptional&lt;NSDate&gt;</code>, or at least <code>NSDate!</code>.</p>