7 Commits

Author SHA1 Message Date
Garrett Moon
b79641d4ee Use indexOfObjectIdenticalTo since we only care if the pointers are equal. Thanks @Adlai-Holler! 2016-07-07 11:13:18 -07:00
Garrett Moon
8081123cb2 Fix visibility assert on iOS 7
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.
2016-07-07 11:08:06 -07:00
Hannah Troisi
c857e809f4 Clean up header comments (for consistent Facebook licensing info) (#1741)
[Licensing] Clean up header comments (for consistent Facebook licensing info)
2016-06-11 23:31:39 -07:00
Garrett Moon
72d7b57abb Don't add zero for readability 2016-05-12 14:44:54 -07:00
Garrett Moon
4c78fb3846 Add setVisibilityDepth setter. 2016-05-12 13:42:05 -07:00
Garrett Moon
b7b8ad54fd Move common implementations to macros 2016-05-12 13:42:05 -07:00
Garrett Moon
af7a2f09d7 Add support for visibility 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.
2016-05-12 13:42:05 -07:00