title: How to convert Data to Int in Swift 3?
body: <p>There're a lot of sources explaining how to make it in <strong>Swift 2</strong> which I took as a base:</p>
  
  <pre><code>var value: Int = 0
  let data: NSData = ...;
  data.getBytes(&amp;value, length: sizeof(Int))
  </code></pre>
  
  <p>Then I updated syntax/naming due to <strong>Swift 3</strong>:</p>
  
  <pre><code>var value: Int = 0
  let data: NSData = ...;
  data.copyBytes(to: &amp;value, count: MemoryLayout&lt;Int&gt;.size)
  </code></pre>
  
  <p>Nevertheless it doesn't work. The compiler doesn't like the type of <code>value</code>, it says it should be <code>UInt8</code>. But I want <code>Int</code>. Anybody knows how can I achieve this?</p>