处理第一次不滑动界面不传递数据的问题

This commit is contained in:
2026-02-11 20:52:56 +08:00
parent f0cb69948e
commit c9743cb363

View File

@@ -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];