title: Get version of a Cocoapods-based library
body: <p>I publish my Swift library as a CocoaPod. For debugging purposes, I want to print my Pod's version string (spec.version) to console.</p>
  
  <p>The following code works:</p>
  
  <pre><code>print(Bundle.init(for: MyClass.self)
      .object(forInfoDictionaryKey: "CFBundleShortVersionString"))        
  </code></pre>
  
  <p>... but it looks hackish, so maybe there's a better way.</p>