Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

xzenon
Copy link

@xzenon xzenon commented Nov 8, 2012

...ew

@xzenon
Copy link
Author

xzenon commented Nov 8, 2012

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.

@OliverLetterer
Copy link
Owner

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]?

@xzenon
Copy link
Author

xzenon commented Nov 9, 2012

You are right, state property will be better approach here I think. I just will setup KVO to track the changes.
Removed delegate things and added isFirstViewControllerViewOverdraggedToLeft property instead.

@OliverLetterer
Copy link
Owner

Am i correct that the property isFirstViewControllerViewOverdraggedToLeft now only returns valid results if a view controller is pushed or popped? How about something like

- (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?

@xzenon
Copy link
Author

xzenon commented Nov 12, 2012

Added isFirstViewControllerViewOverdraggedToLeft getter and status updating while panning to __mainPanGestureRecognizedDidRecognizePanGesture.

@@ -31,7 +31,9 @@



@interface ANAdvancedNavigationController : UIViewController
@interface ANAdvancedNavigationController : UIViewController {
BOOL _isfirstViewControllerViewOverdraggedToLeft;
Copy link
Owner

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.

Copy link
Author

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?

@xzenon
Copy link
Author

xzenon commented Nov 13, 2012

Added value tracking so KVO notifications are not generated when overlap status unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants