title: call a function of a maincontroller after a presented viewcontroller is dismissed
body: <p>I have a MainViewcontroller that present a viewcontroller. The user may take an action that should firstly dismiss the view controller and secondly call a function defined in the MainViewcontroller.</p>
  
  <p>The constraint is this function will create a new vc to be presented. I have tried the viewWillAppear and viewdidAppear of the main controller. That did not work because they are called more than once.</p>
  
  <p>I could also use the notification mechanism but I am not sure that the MainViewController will have appeared before the notification is received.</p>