-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added delegate method to notify when left view is overlapped by right vi... #7
base: master
Are you sure you want to change the base?
Conversation
I need ability to know when right views are positioned in such way that left menu view is overlapped (to be able make some animations on left view depending on overlaps). Added delegate method so now it is possible to know the overlapping status. |
I think a delegate method is the wrong approach for this because this is a property for the current state of an ANAdvancedNavigationController instance. How about a new property -[ANAdvancedNavigationController isFirstViewControllerViewOverlappingWith...] or -[ANAdvancedNavigationController isFirstViewControllerViewOverdraggedToLeft]? |
…f using delegate method
You are right, state property will be better approach here I think. I just will setup KVO to track the changes. |
Am i correct that the property - (BOOL)isFirstViewControllerViewOverdraggedToLeft
{
if (self.viewControllers.count > 0) {
UIViewController *firstRightViewController = self.viewControllers[0];
return firstRightViewController.view.superview.frame.origin.x <= ANAdvancedNavigationControllerDefaultLeftPanningOffset;
}
return NO;
} and maybe make it kvo conform while the user is panning? |
Added isFirstViewControllerViewOverdraggedToLeft getter and status updating while panning to __mainPanGestureRecognizedDidRecognizePanGesture. |
@@ -31,7 +31,9 @@ | |||
|
|||
|
|||
|
|||
@interface ANAdvancedNavigationController : UIViewController | |||
@interface ANAdvancedNavigationController : UIViewController { | |||
BOOL _isfirstViewControllerViewOverdraggedToLeft; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the iVar still needed? I thought - (BOOL)isFirstViewControllerViewOverdraggedToLeft {...}
now always contains a valid result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isFirstViewControllerViewOverdraggedToLeft property is readonly and I need somehow update it before sending KVO notifications. Not sure how to do that without ivar. Could you advice?
Added value tracking so KVO notifications are not generated when overlap status unchanged. |
...ew