Knowledgebase

iOS View Controllers and Navigation Print

  • mobiledevelopment, mobile, guide, howto, solution, zillionkinghost, hosting, support
  • 0

Managing screens.

WHAT A VIEW CONTROLLER IS

An object managing a screen or portion of one, with its own lifecycle.

WHAT THE LIFECYCLE INVOLVES

Loading, appearing, appeared, disappearing, disappeared.

WHAT TO DO IN EACH

Set up once on load Update state before appearing Start work when appeared Stop work when disappearing

WHY THAT LAST POINT

Work continuing on a hidden screen wastes battery and may crash on a deallocated view.

WHAT CONTAINER CONTROLLERS DO

Manage other controllers: navigation stacks, tab bars, split views.

WHAT A NAVIGATION STACK PROVIDES

Pushing and popping screens, with a back control.

WHAT TO ENSURE

That the navigation makes sense from any entry point, including a notification or a link.

WHAT MODAL PRESENTATION IS FOR

A task requiring completion or dismissal before continuing.

WHAT TO AVOID

Stacking modals Modals where a pushed screen would serve

WHAT TO HANDLE

The gesture that dismisses a modal, which users may perform mid-task.

WHAT TO DO ABOUT UNSAVED WORK

Confirm before discarding.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot