Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Issue related to child view controllers #170

Open
bernikovich opened this issue Nov 28, 2016 · 0 comments
Open

Issue related to child view controllers #170

bernikovich opened this issue Nov 28, 2016 · 0 comments

Comments

@bernikovich
Copy link

Hello.

I have issue with custom controllers hierarchy. My VCs stack looks like this:
VCs stack

Code in blue VC:

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
    static UIScrollView *scrollView;
    if (!scrollView) {
        for (UIView *view in self.view.subviews) {
            if ([view isKindOfClass:[UIScrollView class]]) {
                scrollView = (UIScrollView *)view;
                break;
            }
        }
        scrollView.contentSize = CGSizeMake(CGRectGetWidth(scrollView.frame), 2000);
        UIView *content = [UIView new];
        content.backgroundColor = [UIColor redColor];
        content.frame = CGRectMake(0, 0, scrollView.contentSize.width, scrollView.contentSize.height);
        [scrollView addSubview:content];
    }
    
    if (!self.isShyNavBarManagerPresent) {
        TLYShyNavBarManager *scrollManager = [TLYShyNavBarManager new];
        scrollManager.scrollView = scrollView;
        [self setShyNavBarManager:scrollManager viewController:self.parentViewController];
    }
}

I have already tried (with no luck):

  • Replace [self setShyNavBarManager:scrollManager viewController:self.parentViewController]; with [self setShyNavBarManager:scrollManager viewController:self];.

You can check sample project, try to push view controller (press bar button item) and than go back: https://github.com/bernikowich/TLYShyNavBarChildControllerIssue

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

No branches or pull requests

1 participant