处理第一次不滑动界面不传递数据的问题
This commit is contained in:
@@ -308,6 +308,12 @@ static NSString * const KBAISelectedPersonaIdKey = @"KBAISelectedPersonaId";
|
||||
if (weakSelf.currentPage == 1) {
|
||||
[weakSelf.collectionView reloadData];
|
||||
[weakSelf preloadDataForIndexes:@[@0, @1, @2]];
|
||||
// 首次加载完成后,主动保存默认 persona 到 AppGroup,
|
||||
// 避免用户未滑动时键盘扩展拿不到数据
|
||||
if (weakSelf.personas.count > 0) {
|
||||
NSInteger index = MIN(MAX(weakSelf.currentIndex, 0), weakSelf.personas.count - 1);
|
||||
[weakSelf saveSelectedPersonaToAppGroup:weakSelf.personas[index]];
|
||||
}
|
||||
} else if (pageModel.records.count > 0) {
|
||||
NSInteger newCount = weakSelf.personas.count;
|
||||
NSMutableArray<NSIndexPath *> *indexPaths = [NSMutableArray array];
|
||||
|
||||
Reference in New Issue
Block a user