Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions BFNavigationBarDrawer/BFNavigationBarDrawer.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ - (void)setupConstraintsWithNavigationBar:(UINavigationBar *)bar {
toItem:nil
attribute:NSLayoutAttributeNotAnAttribute
multiplier:1
constant:44];
constant:self.frame.size.height];
[self addConstraint:constraint];
}

Expand Down Expand Up @@ -234,13 +234,16 @@ - (void)hideAnimated:(BOOL)animated {
_scrollView.contentOffset = CGPointMake(_scrollView.contentOffset.x, _scrollView.contentOffset.y - topFix);

[self constrainBehindNavigationBar:parentBar];

void (^animations)() = ^void() {
state = BFNavigationBarDrawerStateHiding;
[self.superview layoutIfNeeded];
_scrollView.contentOffset = CGPointMake(_scrollView.contentOffset.x, _scrollView.contentOffset.y + fix);

};
verticalDrawerConstraint.constant = height;
[self.superview layoutIfNeeded];

void (^animations)() = ^void() {
state = BFNavigationBarDrawerStateHiding;
verticalDrawerConstraint.constant = verticalDrawerConstraint.constant - height;
[self.superview layoutIfNeeded];
_scrollView.contentOffset = CGPointMake(_scrollView.contentOffset.x, _scrollView.contentOffset.y + fix);
};


void (^completion)(BOOL) = ^void(BOOL finished) {
if (state == BFNavigationBarDrawerStateHiding) {
Expand Down