DLSlideView
DLSlideView copied to clipboard
如果标签页比较多,vc会被回收
使用过程中,如果标签页比较多 比如10个,一个一个滑到最后,然后在滑回来,发现前面的vc的viewdidload方法重新走了一遍
实验发现 这样写是没问题的
-
(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; }
缓存默认是缓存4个页面,这个可以改源码,也可以自己设计缓存策略。