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

如果标签页比较多,vc会被回收 #41

Open
Engandend opened this issue Jan 3, 2018 · 2 comments
Open

如果标签页比较多,vc会被回收 #41

Engandend opened this issue Jan 3, 2018 · 2 comments

Comments

@Engandend
Copy link

使用过程中,如果标签页比较多 比如10个,一个一个滑到最后,然后在滑回来,发现前面的vc的viewdidload方法重新走了一遍

@Engandend
Copy link
Author

实验发现 这样写是没问题的

  • (UIViewController *)DLCustomSlideView:(DLCustomSlideView *)sender controllerAt:(NSInteger)index{

    if ([_vcs[index] isKindOfClass:[UIViewController class]]) {
    return _vcs[index];
    }

    CommunityChildVC *childVC = [[CommunityChildVC alloc]init];
    [_vcs replaceObjectAtIndex:index withObject:childVC];
    return childVC;
    }

@agdsdl
Copy link
Owner

agdsdl commented Feb 9, 2018

缓存默认是缓存4个页面,这个可以改源码,也可以自己设计缓存策略。

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

No branches or pull requests

2 participants