How to copy values out of a Realm Object to pass to another thread
<p>I have a Realm Object (let's call it File) with a String property called <code>url</code>.
I have created an Alamofire <code>DownloadRequest.DownloadFileDestination</code> block which contains a reference to the <code>url</code> so I can download the file.  However, because this block gets executed on a background thread, Realm throws up an exception.  I don't need to actually access the entire Realm, or even the entire File object - only the property <code>url</code> - so there is no reason to try to open the File object from the Realm in the background thread. </p>

<p>What is the proper way to copy this string (or properties of other types) out of the Realm object to pass to a different thread?</p>

<p>My current solution seems very inelegant - though it does work.</p>

<p><code>let url = "\(object.url)"</code> </p>

<p>This question is not related to a specific block of code - it is more a conceptual question.</p>