mirror of
https://github.com/Instagram/IGListKit
synced 2026-05-06 06:58:26 +00:00
Summary: This change allows arbitrary layouts to be used in tandem with IGListCollectionView and recieve udpated section indices, by conforming to to conform IGListCollectionViewLayoutCompatible. Reviewed By: maxoll Differential Revision: D13671204 fbshipit-source-id: e030f413aefff71754731d1259037077ffb73959
33 lines
1.2 KiB
Objective-C
33 lines
1.2 KiB
Objective-C
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
/**
|
|
A protocol for layouts that defines interaction with an IGListCollectionView, for recieving updated section indexes.
|
|
*/
|
|
NS_SWIFT_NAME(ListCollectionViewLayoutCompatible)
|
|
@protocol IGListCollectionViewLayoutCompatible <NSObject>
|
|
|
|
/**
|
|
Called to notify the layout that a specific section was modified before invalidation. This can be used to optimize
|
|
layout re-calculation.
|
|
|
|
@note When updating a collection view (ex: calling `-insertSections`), `-invalidateLayoutWithContext` gets called on
|
|
the layout object. However, the invalidation context doesn't provide details on which index paths are being modified,
|
|
which typically forces a full layout re-calculation. Layouts can use this method to keep track of which section
|
|
actually needs to be updated on the following `-invalidateLayoutWithContext`. See `IGListCollectionView`.
|
|
|
|
@param modifiedSection The section that was modified.
|
|
*/
|
|
- (void)didModifySection:(NSInteger)modifiedSection;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|