Hi Apple Dev Community,
I'm moving along with my project, whose hierarchy is getting more comlicated by day.
At this point, it has become necessary to programmatically access the top level view controller from within a child view.
My first approach was to create a custum init( ) method for the child view, and then pass the view controller as a parameter in the said init( ) method.
However, my research suggests that that is a bad programming practice.
I have found many articles that show how to programmatically add a child view controller to a parent view controller, but could not find how to add a child view to a parent view controller.
Again, I need a valid reference to the parent view controller from within the child view that doesn't cause the program to explode.
Does anyone know how to achieve this?
Many thanks in advance! 🙂
KC