It appears that didMoveToViewController: can be called with nil,
yet self.parentViewController will *not* be nil. This can result
in calling parent view controller's visibility depth. Instead of
asserting, these methods should return NSNotFound which also happens
to be a really large number, effectively infinite depth.
This adds support for the concept of visibility depth.
Visibility essentially defines the number of user actions it would
take a user to have a view controller visible. Knowing a view controllers
visibility depth allows view controllers to take action such as clearing
out memory that can be restored at a later date.
This patch also add two new view controller subclasses which adopt
the ASManagesChildVisibilityDepth protocol. Any view controller
that has child view controllers can adopt this protocol to indicate
to the child what they're visibility is. For example, ASNavigationController
will return a visibility depth of it's own visibilityDepth + 1 for
a view controller that would be revealed by tapping the back button.