mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-20 13:19:16 +00:00
Merge pull request #918 from levi/master
Inline supplementary kind iteration in data controller
This commit is contained in:
commit
c9a0a3d46f
@ -40,8 +40,7 @@
|
||||
|
||||
- (void)prepareForReloadData
|
||||
{
|
||||
NSArray *kinds = [self supplementaryKinds];
|
||||
for (NSString *kind in kinds) {
|
||||
for (NSString *kind in [self supplementaryKinds]) {
|
||||
LOG(@"Populating elements of kind: %@", kind);
|
||||
NSMutableArray *indexPaths = [NSMutableArray array];
|
||||
NSMutableArray *nodes = [NSMutableArray array];
|
||||
@ -83,8 +82,7 @@
|
||||
|
||||
- (void)prepareForInsertSections:(NSIndexSet *)sections
|
||||
{
|
||||
NSArray *kinds = [self supplementaryKinds];
|
||||
for (NSString *kind in kinds) {
|
||||
for (NSString *kind in [self supplementaryKinds]) {
|
||||
LOG(@"Populating elements of kind: %@, for sections: %@", kind, sections);
|
||||
NSMutableArray *nodes = [NSMutableArray array];
|
||||
NSMutableArray *indexPaths = [NSMutableArray array];
|
||||
@ -116,8 +114,7 @@
|
||||
|
||||
- (void)willDeleteSections:(NSIndexSet *)sections
|
||||
{
|
||||
NSArray *kinds = [self supplementaryKinds];
|
||||
for (NSString *kind in kinds) {
|
||||
for (NSString *kind in [self supplementaryKinds]) {
|
||||
NSArray *indexPaths = ASIndexPathsForMultidimensionalArrayAtIndexSet([self editingNodesOfKind:kind], sections);
|
||||
|
||||
[self deleteNodesOfKind:kind atIndexPaths:indexPaths completion:nil];
|
||||
@ -127,8 +124,7 @@
|
||||
|
||||
- (void)prepareForReloadSections:(NSIndexSet *)sections
|
||||
{
|
||||
NSArray *kinds = [self supplementaryKinds];
|
||||
for (NSString *kind in kinds) {
|
||||
for (NSString *kind in [self supplementaryKinds]) {
|
||||
NSMutableArray *nodes = [NSMutableArray array];
|
||||
NSMutableArray *indexPaths = [NSMutableArray array];
|
||||
[self _populateSupplementaryNodesOfKind:kind withSections:sections mutableNodes:nodes mutableIndexPaths:indexPaths];
|
||||
@ -154,8 +150,7 @@
|
||||
|
||||
- (void)willMoveSection:(NSInteger)section toSection:(NSInteger)newSection
|
||||
{
|
||||
NSArray *kinds = [self supplementaryKinds];
|
||||
for (NSString *kind in kinds) {
|
||||
for (NSString *kind in [self supplementaryKinds]) {
|
||||
NSArray *indexPaths = ASIndexPathsForMultidimensionalArrayAtIndexSet([self editingNodesOfKind:kind], [NSIndexSet indexSetWithIndex:section]);
|
||||
NSArray *nodes = ASFindElementsInMultidimensionalArrayAtIndexPaths([self editingNodesOfKind:kind], indexPaths);
|
||||
[self deleteNodesOfKind:kind atIndexPaths:indexPaths completion:nil];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user