DLSlideView icon indicating copy to clipboard operation
DLSlideView copied to clipboard

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

Open Engandend opened this issue 8 years ago • 2 comments

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

Engandend avatar Jan 03 '18 07:01 Engandend

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

  • (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; }

Engandend avatar Jan 03 '18 07:01 Engandend

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

agdsdl avatar Feb 09 '18 07:02 agdsdl