Dismissing modal Views

Discussion in 'iOS Programming' started by mathieuhendey, Dec 30, 2011.

  1. mathieuhendey macrumors newbie

    Joined:
    Dec 27, 2011
    #1
    Am I okay to just call [self dismissModalViewControllerAnimated:YES] from the modal view controller or do I have to do it from the parent controller? It works from the modal view, but I've seen some sources state that delegating to the parent is better. Is my app going to get rejected if I don't delegate?
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Shouldn't be a problem. I do it all the time. Apple won't reject the app for this. And, according to the UIViewController Class Reference discussion for dismissModalViewControllerAnimated:
     
  3. mathieuhendey thread starter macrumors newbie

    Joined:
    Dec 27, 2011
    #3
    Great, thanks.
     
  4. North Bronson macrumors 6502

    Joined:
    Oct 31, 2007
    Location:
    San José
    #4
    The object that was responsible for presenting your modal controller should be the same object responsible for dismissing your modal controller. It will be a cleaner approach. It will help abstract the design of your view controller.
     

Share This Page