title: How to convert a float value to byte array in swift?
body: <p>The code which I am using for getting data in bytes, but I am not getting correct byte data for float value</p>
  
  <pre><code>let count = data.length / sizeof(UInt32)
  
  // create array of appropriate length:
  var array = [UInt32](count: count, repeatedValue: 0)
  
  // copy bytes into array
  data.getBytes(&amp;array, length:count * sizeof(UInt32))
  
  print(array)
  </code></pre>