title: How do I create a dictionary/map in Swift with dates as keys and booleans as values?
body: <p>Using swift I want to make a map, using dates as keys and booleans as values. In java I would do the following:</p>
  
  <pre><code>private  Map&lt;Date,Boolean&gt; map = new HashMap&lt;&gt;();
  
  private void add() {
      long today = 9999999l;
      map.put(new Date(today), Boolean.TRUE);
      Boolean result = map.get(new Date(today));
      System.out.println(result);
  }
  
  public static void main(String[] args) {
      new Main().add();
  }
  </code></pre>
  
  <p>In swift I have the following:</p>
  
  <pre><code>private var statusOfCells = [NSDate: Bool]()
  
  if let domain = statusOfCells[cell.currentDate] as Bool? {
  if (domain){
   doSomething()
   }
  }
  </code></pre>
  
  <p>Which results in a fatal error: unexpectedly found nil while unwrapping an Optional value. </p>
  
  <p>I can't seem to get my head around the optional unwrapping. How would I do it in swift?</p>