Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Adding a new API to support adding 1:many listeners to observe when an `IGListAdapter` finishes performing an update event. It supports: - `performUpdates:` - `reloadData...` - Even handling update triggered from //inside// a section controller Differential Revision: D6108096 fbshipit-source-id: d0b43d83f1963fdbf6ef388685cbd8f6890177fa
- Loading branch information
1 parent
48aff22
commit 5cf01cc
Showing
10 changed files
with
375 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Copyright (c) 2016-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class IGListAdapter; | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** | ||
The type of update that was performed by an `IGListAdapter`. | ||
*/ | ||
NS_SWIFT_NAME(ListAdapterUpdateType) | ||
typedef NS_ENUM(NSInteger, IGListAdapterUpdateType) { | ||
/** | ||
`-[IGListAdapter performUpdatesAnimated:completion:]` was executed. | ||
*/ | ||
IGListAdapterUpdateTypePerformUpdates, | ||
/** | ||
`-[IGListAdapter reloadDataWithCompletion:]` was executed. | ||
*/ | ||
IGListAdapterUpdateTypeReloadData, | ||
/** | ||
`-[IGListCollectionContext performBatchAnimated:updates:completion:]` was executed by an `IGListSectionController`. | ||
*/ | ||
IGListAdapterUpdateTypeItemUpdates, | ||
}; | ||
|
||
NS_SWIFT_NAME(ListAdapterUpdateListener) | ||
@protocol IGListAdapterUpdateListener <NSObject> | ||
|
||
/** | ||
Notifies a listener that the listAdapter was updated. | ||
@param listAdapter The `IGListAdapter` that updated. | ||
@param update The type of update executed. | ||
@param animated A flag indicating if the update was animated. Always `NO` for `IGListAdapterUpdateTypeReloadData`. | ||
@note This event is sent before the completion block in `-[IGListAdapter performUpdatesAnimated:completion:]` and | ||
`-[IGListAdapter reloadDataWithCompletion:]` is executed. This event is also delivered when an | ||
`IGListSectionController` updates via `-[IGListCollectionContext performBatchAnimated:updates:completion:]`. | ||
*/ | ||
- (void)listAdapter:(IGListAdapter *)listAdapter | ||
didFinishUpdate:(IGListAdapterUpdateType)update | ||
animated:(BOOL)animated; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.