Identifier for Vendor is gettnig changed everyTime app is reinstalled
<p>I have created a function to get UUID    </p>

<pre><code>func deviceUUID() -&gt; String {
    return UIDevice.currentDevice().identifierForVendor?.UUIDString ?? ""
}
</code></pre>

<p>But the problem is that when ever I uninstall the app from same device and re-install it. I am getting a totally new UUIDString. If this the default behaviour then can I get previous UUID somehow ? because I have UUID as user ID in our server.</p>

<p>I do have a solution in my mind but I do not know that will it work or not so please guide me on this.</p>

<p>Lets say I get the ID first time and save it in keychains. When user reinstall the app I get the ID from keychains. Is this possible ?</p>