title: Get path to assets file in iOS: NSBundle is missing
body: <p>I am trying to get the <em>path</em> to a file I have in the <code>Assets.xcassets</code> directory for my iOS app, but I am not able to. It seems like I should use <code>NSBundle.mainBundle()</code> somehow, but Xcode cannot find <code>NSBundle</code> <em>even though I import Foundation or UIKit</em>. If I do auto completion on "NSBundle" I get the following options:</p>
  
  <pre><code>NSBundleErrorMaximum
  NSBundleErrorMinimum
  NSBundleResourceRequest
  NSBundleExecutableArchitecturePPC
  NSBundleExecutableArchitectureI386
  NSBundleExecutableArchitecturePPC64
  NSBundleExecutableArchitectureX86_64
  NSBundleOnDemandResourceInvalidTagError
  </code></pre>
  
  <p>I have no clue what these are for. So my questions are:</p>
  
  <ol>
  <li>How can I import <code>NSBundle</code> into my project?</li>
  <li>How can I get the path to the following file: <code>Assets.xcassets/Database.dataset/database.txt</code>?</li>
  </ol>
  
  <p>Note that I am able to get the <em>contents</em> of the file doing the following, but I want the <em>path</em> to the file.</p>
  
  <pre><code>fileprivate static func readDatabaseFileFromAssets() -&gt; NSDictionary
  {
      let databaseAsset = NSDataAsset(name: "Database", bundle: Bundle.main)
      let json = try? JSONSerialization.jsonObject(with: databaseAsset!.data, options: JSONSerialization.ReadingOptions.allowFragments)
      return json as! NSDictionary
  }
  </code></pre>