title: Notification in Swift returning UserInfo in dictionary
body: <p>I have a Notification that returns a dictionary, much like in objective-c, but I am not getting the results I expect.</p>
  
  <p>Here is the method that is posting the Notification.  It's actually returning the results (date) of date picker.</p>
  
  <pre><code>@IBAction func dateOfBirthAction(sender: AnyObject) {
  
      println("Date: \(dateOfBirthPicker.date)")
  
      var selectedDateDictionary = [dateOfBirthPicker.date, "dateOfBirth"]
  
      NSNotificationCenter.defaultCenter().postNotificationName("dateOfBirth", object: nil, userInfo: [NSObject():selectedDateDictionary])
  
  }
  </code></pre>
  
  <p>Here is the notification observer:</p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
  
      NSNotificationCenter.defaultCenter().addObserver(self, selector: "dateOfBirth:", name: "dateOfBirth", object: nil)
  
  }
  
  func dateOfBirth(notification: NSNotification) {
  
      println("userInfo: \(notification.userInfo)")
  
      let returnedDateOfBirth = notification.userInfo!["dateOfBirth"] as NSString
      println("returnedDateOfBirth: \(returnedDateOfBirth)")
  
      playerInformationDateOfBirthLabel.text  = returnedDateOfBirth
  }
  </code></pre>
  
  <p>I'm getting the following error on the line line <code>let returnedDateOfBirth:String = notification.userInfo["dateOfBirth"]</code>   </p>
  
  <pre><code>userInfo: Optional([&lt;NSObject: 0x7fb15a44a880&gt;: &lt;_TtCSs23_ContiguousArrayStorage00007FB15A4D4380 0x7fb15a4206a0&gt;(
  2014-09-18 12:07:07 +0000,
  dateOfBirth
  )
  ])
  fatal error: unexpectedly found nil while unwrapping an Optional value
  </code></pre>
  
  <h2>FULL SOLUTION</h2>
  
  <pre><code>@IBAction func dateOfBirthAction(sender: AnyObject) {
  
      var selectedDateDictionary = ["birthDate" : dateOfBirthPicker.date]
  
      NSNotificationCenter.defaultCenter().postNotificationName("foundABirthDate", object: nil, userInfo:selectedDateDictionary)
  }
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      NSNotificationCenter.defaultCenter().addObserver(self, selector: "dateOfBirth:", name: "foundABirthDate", object: nil)
  
  }
  
  func dateOfBirth(notification: NSNotification) {
  
      let playerBirthDate = notification.userInfo!["birthDate"] as NSDate
  
      var dateFormatter: NSDateFormatter = NSDateFormatter()
  
      //Specifies a long style, typically with full text, such as “November 23, 1937”.
      dateFormatter.dateStyle = NSDateFormatterStyle.LongStyle
  
      let dateConvertedToString: String = dateFormatter.stringFromDate(playerBirthDate)
  
      playerInformationDateOfBirthLabel.text  = dateConvertedToString
  }
  </code></pre>