title: Swift: open calendar to a specific date
body: <p>I use the following code to open calendar to a specific date (2018/01/12):</p>
  
  <pre><code>    var userCalendar = Calendar.current
      var dateComponents = DateComponents.init()
      dateComponents.year = 2018
      dateComponents.month = 1
      dateComponents.day = 12
      let customDate = userCalendar.date(from: dateComponents)
      let interval = (customDate?.timeIntervalSinceReferenceDate)!
      if let url = URL(string: "calshow:\(interval)") {
          UIApplication.shared.open(url, options: [:], completionHandler: nil)
      }
  </code></pre>
  
  <p>Such code seems to work. The main problem is that if you launch it for the first time, the calendar would automatically jump to the current date. Only when you run it for the second time will the calendar jump to the specified date. Why so?</p>