|
[Objective-C] Correct way for to scroll after of reloadData completion |
|
 |
// correct way for to scroll, or execute a block of code, only after of reloadData completion
[self.collectionView reloadData];
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
// scroll to item
NSIndexPath *indexPath = [NSIndexPath indexPathForItem:3 inSection:0];
[self.collectionView selectItemAtIndexPath:indexPath animated:YES scrollPosition:UICollectionViewScrollPositionLeft];
}];
|
|
|
|
|
|
|
|
Copyright © 1996-2021 Centro Studi Informatica di Danilo Priore. All rights reserved. P.I.10149810581. |
|
|
|