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.
The following is what I have already tired, but it does not seem to work?
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
if self.isBeingPresented || self.isMovingToParent {
print("hello")
}
}