title: loading data object from local file in Swift 3
body: <p>I'm struggling to get an image file loaded in Swift 3. 
  Here is the code:</p>
  
  <pre><code>do {
      let imageData = try Data(contentsOf: imageUrl2.asURL()) 
  } catch { 
      print ("loading image file error") 
  }
  </code></pre>
  
  <p>And the current Url String is: </p>
  
  <pre><code>file:///Users/veikoherne/Library/Developer/CoreSimulator/Devices/889A08D5-B8CC-458C-99FF-643A4BA1A806/data/Containers/Data/Application/F64ED326-7894-4EE7-AA3B-B1BB10DF8259/Documents/img2017-03-23 17:39:24.jpg
  </code></pre>
  
  <p>and obviously I have checked that this file exists and is valid image. It always ends up telling me "loading image file error". Anyone have experiences loading local data in Swift 3?</p>
  
  <p>The answer mentioned was using NSData object and probably Swift 2. Current Swift 3 refuses to bridge NSData to Data, that's why I have to use Data. </p>