title: How to trigger an action in viewDidAppear only the first time a view controller is shown?
body: <p>Essentially I would like to print the following "hello" message only once when the view appears only the first time when the app first loads. The ViewController can be shown again when a tab in a tab controller triggers it, but it should not print the message after the very first time. Going back to the ViewController should not trigger this "hello" to print.</p>
  
  <p><strong>The following is what I have already tired, but it does not seem to work?</strong></p>
  
  <pre><code>override func viewDidAppear(_ animated: Bool) {
      super.viewDidAppear(animated)
  
      if self.isBeingPresented || self.isMovingToParent {
          print("hello")
      }
  }
  </code></pre>