I have a view controllerA with segmented control, and I have added two view controller's(B & C) views in controllerA on different segment selection.I have one button each on controllerB and controllerC.On button click of each controllerB & controllerC, I am going to controllerD.
How do I know from which controller I am coming from?
I have tried code below but I think due to views of controller's (B & C) added to controllerA, it is giving me nil.
guard let parent = self.parent else {return}
How to get parent in this scenario?