This repository has been archived by the owner. It is now read-only.

Wrong behavior for updating left/right view frames #78

Closed
alexburkhay opened this Issue Jan 22, 2013 · 4 comments

Comments

Projects
None yet
2 participants
@alexburkhay
    • (void)underLeftWillAppear (also underRightWillAppear) has wrong order of method calls -
      when you call:
      [self.underLeftViewController viewWillAppear:NO];
      [self.view insertSubview:self.underLeftView belowSubview:self.topView];
      [self updateUnderLeftLayout];

for iOS5 and greater it calls viewWillAppear 2 times in your underleftcontroller (this is wrong), but in this calls view.frame will be wrong (not latest size) because it'll be changed only in updateUnderLeftLayout
I think right behaviour (replace 3 lines for this one) is:
UIView *leftView = self.underLeftView;
[self updateUnderLeftLayout];
[self.view insertSubview:leftView belowSubview:self.topView];
if (current_os_version < iOS_5.0) [self.underLeftViewController viewWillAppear:NO];
(same order for underRightWillAppear)

  1. Also why when u call method anchorTopViewOffScreenTo your left or right controller view frame won't be changed automatically to fill the screen (animated or not) ?

Thank you. P.S. Please, update cocoapods podspec to the last version:)

@enriquez

This comment has been minimized.

Show comment Hide comment
@enriquez

enriquez Jan 23, 2013

Owner

You're right about viewWillAppear being called twice. fixed here: ef3574b (note: we only support iOS 5 and up)

I don't understand the issue with the order of the calls. The frame is set relative to container view, so it shouldn't matter.

anchorTopViewOffScreenTo will not automatically adjust the under view to fill the screen. This is expected behavior.

Owner

enriquez commented Jan 23, 2013

You're right about viewWillAppear being called twice. fixed here: ef3574b (note: we only support iOS 5 and up)

I don't understand the issue with the order of the calls. The frame is set relative to container view, so it shouldn't matter.

anchorTopViewOffScreenTo will not automatically adjust the under view to fill the screen. This is expected behavior.

@alexburkhay

This comment has been minimized.

Show comment Hide comment
@alexburkhay

alexburkhay Jan 23, 2013

"I don't understand the issue with the order of the calls. The frame is set relative to container view, so it shouldn't matter." - on viewWillAppear method (inside our custom left or right controller) we always expect that our view has the most recent version of frame. That's why frame resizing [self updateUnderLeftLayout]; should go before [self.view insertSubview:leftView belowSubview:self.topView]; (this will call viewwillappear in our custom controller)

"I don't understand the issue with the order of the calls. The frame is set relative to container view, so it shouldn't matter." - on viewWillAppear method (inside our custom left or right controller) we always expect that our view has the most recent version of frame. That's why frame resizing [self updateUnderLeftLayout]; should go before [self.view insertSubview:leftView belowSubview:self.topView]; (this will call viewwillappear in our custom controller)

@enriquez

This comment has been minimized.

Show comment Hide comment
@enriquez

enriquez Jan 24, 2013

Owner

I see, you want to modify the frame of the under view in its viewWillAppear. The current state of the code clobbers any modifications made to the frame.

Owner

enriquez commented Jan 24, 2013

I see, you want to modify the frame of the under view in its viewWillAppear. The current state of the code clobbers any modifications made to the frame.

@enriquez enriquez closed this in f866037 Jan 24, 2013

@alexburkhay

This comment has been minimized.

Show comment Hide comment
@alexburkhay

alexburkhay Jan 24, 2013

Nope) In method viewWillAppear in some cases we need to update frames for some subviews of this under view according to latest version of underview frame. (if im not wrong all geometry tansformations with subviews of controller.view should be in viewwillappear method )
thanks:)

Nope) In method viewWillAppear in some cases we need to update frames for some subviews of this under view according to latest version of underview frame. (if im not wrong all geometry tansformations with subviews of controller.view should be in viewwillappear method )
thanks:)

luc3k pushed a commit to luc3k/ECSlidingViewController that referenced this issue Feb 5, 2014

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.