Stack's at the UIViewController of iOs

0

I am mixing a lot of things about the way the different controllers navigate.

  • When I do a func present(UIViewController, animated: Bool, completion: (() -> Void)? = nil) , is there a stack in which my controllers are added? If so, what difference would there be with respect to the operation of UINavigationController ?
  • What is the difference between a presentation of the modal type and one of the show type? (I know it is explained on the apple page but I would like it if someone can explain it to me with his words)
  • When should I worry about having many instances of the drivers? That is, when the controllers remain referenced (For example: in a stack)?
  • asked by MatiEzelQ 18.11.2016 в 00:37
    source

    1 answer

    3
  • When you call the function func present(UIViewController, animated: Bool, completion: (() -> Void)? = nil) from a UIViewController, you are presenting the new controller in a modal way, not adding it to the stack. That's the difference with respect to a UINavigationController , it does add drivers to the stack.
  • A good example of modal presentation is the screens to add information (to a table, a new contact, calendar event, etc). You can see that there is no back button, usually Accept / Save and Cancel appear, because their actions are usually limited to discard the view or save the information it contains.
  • If you design your UI using Storyboards, and do not do anything strange, I'd say never. The moment you navigate backwards on the stack, and if you do not manually have a reference to the unstacked controller, it is removed from memory.
  • Greetings

        
    answered by 23.12.2016 / 12:00
    source