Tip:
Highlight text to annotate it
X
but sometimes one screen is not enough and even to strings flipping between
each other aunt enough if you've used applications like say
the settings application you'll have used navigation controllers here i'm not
talking about the contents of the screens themselves these could be table
views like obscene here or images or video i'm talking about the blue bar at
the top
something that lets as keep track of where we are and how to get back
settings uses it
safari uses it to manage bookmarks
contacts uses it
being music applications use it
and this is something called the navigation controller
it's a built-in object they can keep track of where you are an automatically
provide you dont single breadcrumb level to get back to the previous view
and when you are apt to not always fit on one screen
you have multiple levels during frumpy master level to a detail level and even
for the down this is the classic iowa sway
of managing it
to use this navigation controlling when our application hope ans we'll create
the empty window object as usual
but instead of loading our first view directly into the window
we'll create an navigation controller object which has that blue bar and it
can hold other view controllers
we will load our first you into it
and then we'll move the whole thing into the window
and as you start to use the application
say perhaps you touch abundant in the first view controller
instead of that view controller directly creating and transitioning to the next
few controller as we saw in the utility at it does created but it tells the
navigation controller to handle the transition
and the navigation control it takes that second you controller and makes it
appear the term we use it
to the top of the navigation stack you can think of this like a deck of cards
we're loading this end of the top of the deck
select something on the second view controller we talked to the knife
controller again we get the third one loaded on top
or the other view control is right now still exist they're just not visible
and as the navigation controller has been the one responsible for pushing
these onto the stack it also knows how to go back and push them off
so i someone taps the back button on the navigation controller to go back it will
take care of taking whatever the top of the second moving it away the term it's
actually used his that view control is being popped off the stack
we could go back button again we get the second one popped off and we're back at
the start
the job of the navigation controller is to take care of the stack of u
controllers so we don't have to do
and to get started with this x could actually gives us a project time for
master detail applications that creates a simple example of this then the next
section we're going to see how to go ahead and take a look at that