title: How to convert a double into a byte array in swift?
body: <p>I know how to do it in java (see <a href="https://stackoverflow.com/questions/2905556/how-can-i-convert-a-byte-array-into-a-double-and-back">here</a>), but I couldn't find a swift equivalent for java's ByteBuffer, and consequently its .putDouble(double value) method.
  </p>Basically, I'm looking for a function like this:</p>
  
  <pre><code>func doubleToByteArray(value: Double) -&gt; [UInt8]? {
      . . .
  }
  doubleToByteArray(1729.1729) // should return [64, 155, 4, 177, 12, 178, 149, 234]
  </code></pre>