title: Saving Date in UserDefaults of the first time the App was opened
body: <p>I am trying to set the <code>Date()</code> the very first time an App is opened. This will be set in <code>UserDefaults</code>.</p>
  
  <p>I used <code>register()</code> to save the date in UserDefault. The problem is.. this value seems to be saving on <em>every</em> launch, which defeats the purpose of UserDefaults.register.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>let initialOpen: NSDictionary = ["FirstOpen" : Date()]
  UserDefaults.standard.register(defaults: initialOpen as! [String : AnyObject])
  
  let firstOpenDate = UserDefaults.standard.value(forKey: "FirstOpen")
  print("First Opened: \(firstOpenDate)")
  </code></pre>
  
  <p>I am calling this within <code>didFinishLaunchingWithOptions</code>.</p>
  
  <p><strong>How can I record the time that the App is launched for the first time in UserDefaults?</strong></p>