title: Passing data between Tab Bar Controllers with NSNotificationCenter in Swift
body: <p>I'm trying to pass data between tab bar controllers for the firts time, but it doesn't work. 
  First Controller:</p>
  
  <pre><code>class FirstViewController: UIViewController {
  @IBOutlet weak var sentNotificationLabel: UILabel!
  
  override func viewDidLoad() {
      super.viewDidLoad()
      NSNotificationCenter.defaultCenter().addObserver(self, selector: "updateNotificationSentLabel:", name: mySpecialNotificationKey, object: nil)
  }
  
  @IBAction func notify() {
      NSNotificationCenter.defaultCenter().postNotificationName(mySpecialNotificationKey, object: nil, userInfo:["message":"Something"])
  }
  
  func updateNotificationSentLabel(notification:NSNotification) {
      let userInfo:Dictionary&lt;String,String!&gt; = notification.userInfo as Dictionary&lt;String,String!&gt;
      let messageString = userInfo["message"]
      sentNotificationLabel.text = messageString
  
  
  }
  }
  </code></pre>
  
  <p>Here it works ok, the sentNotificationLabel.text is "Something"</p>
  
  <p>Second Controller is similiar, but he's not receiving any notification.</p>
  
  <pre><code>class SecondViewController: UIViewController {
  @IBOutlet weak var notificationLabel: UILabel!
  
  override func viewDidLoad() {
      super.viewDidLoad()
      NSNotificationCenter.defaultCenter().addObserver(self, selector: "updateLabel:", name: mySpecialNotificationKey, object: nil)
  }
  
  func updateLabel(notification:NSNotification) {
      let userInfo:Dictionary&lt;String,String!&gt; = notification.userInfo as Dictionary&lt;String,String!&gt;
      let messageString = userInfo["message"]
      notificationLabel.text = messageString
  
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>What I am doing wrong? How to change that? </p>