The best solution, if you can control it, is to try to review your code so that it doesn't matter if only the controller is pressed or its child just popped up. In essence, the view controller mediates between its view and the data that the application is running. While this data is being updated, the controller does not have to worry about what happened before its appearance. The tasks that your controller currently does based on the previous state of the application, such as updating data, may be better located in another class.
Another possibility, if you are using storyboards, is to rely on -prepareForSegue:sender: instead of -viewDidAppear . The segment that you passed in this method has properties that the source and destination view controllers define, and this is usually enough information to tell you how your controller has become current.
If none of these work in your case, consider porting the configuration code to one or more different methods. The root of the problem you are facing is that -viewWillAppear doesnโt really mean what you need. Create a method that means what you need, such as -childControllerFinished , and use this to do the necessary configuration work.
Caleb source share