title: declare NotificationCenter.default.addObserver [swift]
body: <p>How do you add an observer in Swift to the notification center?</p>
  
  <p>do it like this: </p>
  
  <pre><code>override func viewDidLoad() {
          super.viewDidLoad()
          NotificationCenter.default.addObserver(self, selector: #selector(ReloadData), name: NSNotification.Name(rawValue: "ReloadData"), object: nil)
  
  }
  @objc func ReloadData(notification: NSNotification) {
          // func
          print ("FUNC TEST")
      }
  </code></pre>
  
  <p>But every time the controller closes/opens (switch between the tabs of the tabbar), a new listener is added.
  And when I call </p>
  
  <pre><code>print ("Call Notif")
  NotificationCenter.default.post(name: NSNotification.Name(rawValue: "ReloadData"), object: nil)
  </code></pre>
  
  <p>"func ReloadData" is called several times. Console:</p>
  
  <pre><code>Call Notif
  FUNC TEST
  FUNC TEST
  </code></pre>
  
  <p>will switch between the tabs of the tabbar again.</p>
  
  <pre><code>Call Notif
  FUNC TEST
  FUNC TEST
  FUNC TEST
  </code></pre>
  
  <p>How can I oblige you only once ?</p>