title: Get Data from XCAsset catalog
body: <p>I understand that to get images from the asset catalog i can use UIImage(named: "fileName") to do it.</p>
  
  <p>however, what if i am getting DATA from the XCAsset catalog?  I can't figure this out.</p>
  
  <p>I have tried, </p>
  
  <pre><code>let url = NSBundle.mainBundle().URLForResource("fileName", withExtension: nil)
  let data = NSData(contentsOfURL: url!)
  </code></pre>
  
  <p>But it is nil.  I do not know how to get data from the XCAssets catalog.  If anyone can help me out (googling hasn't helped) please let me know I will be very thankful!</p>
  
  <p>Update:</p>
  
  <p>Why am I trying to get data from an asset catalog?  I dragged an animated gif into the asset catalog.  And the asset catalog interprets that as DATA.  This is why I am trying to get data out of the asset catalog.</p>
  
  <p>Update:
  This is a screen shot of my Assets.xcassets folder looks like.</p>
  
  <p><a href="https://i.stack.imgur.com/ezf6B.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ezf6B.png" alt="image"></a>
  It has a file called "_Loading" and on the right it is considered a "Data set".
  I'm not sure how to get the data set from the Assets catalog.</p>