I think this can be accomplished by separating concerns a little bit more here - in particular, note that the Signup and Login controllers both assume they were presented modally. Instead, have them ask their delegate to handle the showing/hiding.
# from login/signup controller
delegate.should_hide(self)
# from main controller
def should_hide(controller)
self.dismissViewControllerAnimated(true, completion: nil)
end
And here's the answer to your question
# from signup controller
def should_hide(controller)
self.dismissViewControllerAnimated(true, completion: -> do
delegate.should_hide(self)
end)
end
This will hide each window one at a time, which you might not want... if you want to hide both windows at the same time, try this:
# from signup controller
def should_hide(controller)
# this will ask the main controller to hide the presented controller...
# and BOTH controllers will hide at the same time!
delegate.should_hide(self)
end