diff --git a/docs/Classes.html b/docs/Classes.html index 023aef021..4c39206ce 100644 --- a/docs/Classes.html +++ b/docs/Classes.html @@ -10,6 +10,7 @@ +
@@ -34,7 +35,7 @@ Best Practices and FAQ - + @@ -173,6 +174,9 @@ + @@ -200,31 +204,37 @@ @@ -248,6 +258,14 @@ +
@@ -263,9 +281,9 @@

Classes

  • - - - IGListAdapter + + + IGListBatchUpdateData
    @@ -273,26 +291,23 @@

    Classes

    -

    IGListAdapter objects provide an abstraction for feeds of objects in a UICollectionView by breaking each object -into individual sections, called section controllers. These controllers (objects subclassing to -IGListSectionController) act as a data source and delegate for each section.

    - -

    Feed implementations must act as the data source for an IGListAdapter in order to drive the objects and section -controllers in a collection view.

    +

    An instance of IGListBatchUpdateData takes section indexes and item index paths +and performs cleanup on init in order to perform a crash-free +update via -[UICollectionView performBatchUpdates:completion:].

    - See more + See more

    Declaration

    Objective-C

    
    -@interface IGListAdapter : NSObject
    +@interface IGListBatchUpdateData : NSObject

    Swift

    -
    class ListAdapter : NSObject
    +
    class ListBatchUpdateData : NSObject
    @@ -306,9 +321,9 @@

    Declaration

  • @@ -316,29 +331,21 @@

    Declaration

    -

    An IGListAdapterUpdater is a concrete type that conforms to IGListUpdatingDelegate. -It is an out-of-box updater for IGListAdapter objects to use.

    -
    -

    Note

    - This updater performs re-entrant, coalesced updating for a list. It also uses a least-minimal diff -for calculating UI updates when IGListAdapter calls --performUpdateWithCollectionView:fromObjects:toObjects:completion:. - -
    +

    A result object returned when diffing with sections.

    - See more + See more

    Declaration

    Objective-C

    
    -@interface IGListAdapterUpdater : NSObject <IGListUpdatingDelegate>
    +@interface IGListIndexPathResult : NSObject

    Swift

    -
    class ListAdapterUpdater : NSObject, ListUpdatingDelegate
    +
    class ListIndexPathResult : NSObject
    @@ -352,9 +359,9 @@

    Declaration

  • @@ -362,23 +369,21 @@

    Declaration

    -

    An instance of IGListBatchUpdateData takes section indexes and item index paths -and performs cleanup on init in order to perform a crash-free -update via -[UICollectionView performBatchUpdates:completion:].

    +

    A result object returned when diffing with indexes.

    - See more + See more

    Declaration

    Objective-C

    
    -@interface IGListBatchUpdateData : NSObject
    +@interface IGListIndexSetResult : NSObject

    Swift

    -
    class ListBatchUpdateData : NSObject
    +
    class ListIndexSetResult : NSObject
    @@ -392,9 +397,9 @@

    Declaration

  • @@ -402,38 +407,21 @@

    Declaration

    -

    This section controller uses a data source to transform its top level object into an array of diffable view models. -It then automatically binds each view model to cells via the IGListBindable protocol.

    - -

    Models used with IGListBindingSectionController should take special care to always return YES for identical -objects. That is, any objects with matching -diffIdentifiers should always be equal, that way the section controller -can create new view models via the data source, create a diff, and update the specific cells that have changed.

    - -

    In Objective-C, your -isEqualToDiffableObject: can simply be:

    -
    - (BOOL)isEqualToDiffableObject:(id)object {
    -  return YES;
    -}
    -
    - -

    In Swift:

    -
    func isEqual(toDiffableObject object: IGListDiffable?) -> Bool {
    -  return true
    -}
    -
    - -

    Only when -diffIdentifiers match is object equality compared, so you can assume the class is the same, and the -instance has already been checked.

    +

    An object representing a move between indexes.

    - See more + See more

    Declaration

    Objective-C

    
    -@interface IGListBindingSectionController < __covariant ObjectType
    -    : id <IGListDiffable>
    -> : IGListSectionController @end
    +@interface IGListMoveIndex : NSObject + +
    +
    +

    Swift

    +
    class ListMoveIndex : NSObject
    @@ -447,9 +435,9 @@

    Declaration

  • @@ -457,29 +445,21 @@

    Declaration

    -

    This UICollectionView subclass allows for partial layout invalidation using IGListCollectionViewLayout.

    -
    -

    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. IGListCollectionView gives IGListCollectionViewLayout the -missing information to re-calculate only the modified layout attributes. - -
    +

    An object representing a move between indexes.

    - See more + See more

    Declaration

    Objective-C

    
    -@interface IGListCollectionView : UICollectionView
    +@interface IGListMoveIndexPath : NSObject

    Swift

    -
    class ListCollectionView : UICollectionView
    +
    class ListMoveIndexPath : NSObject
    @@ -493,9 +473,9 @@

    Declaration

  • @@ -503,72 +483,26 @@

    Declaration

    -

    This UICollectionViewLayout subclass is for vertically or horizontally scrolling lists of data with variable widths and -heights. It supports an infinite number of sections and items. All work is done on the main thread, and while extremely efficient, -care must be taken not to stall the main thread in sizing delegate methods.

    - -

    This layout piggybacks on the mechanics of UICollectionViewFlowLayout in that:

    - -
      -
    • Your UICollectionView data source must also conform to UICollectionViewDelegateFlowLayout
    • -
    • Header support given via UICollectionElementKindSectionHeader
    • -
    - -

    All UICollectionViewDelegateFlowLayout methods are required and used by this layout:

    -
    - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
    -- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section;
    -- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section;
    -- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section;
    -- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section;
    -
    - -

    In a vertically scrolling layout, sections and items are put into the same horizontal row until the max-x position -of an item extends beyond the width of the collection view. When that happens, the item is newlined to the next row. -The y position of that row is determined by the maximum height (including section insets) of the section/item of the previous row.

    - -

    Ex. of a section (2,0) with a large width causing a newline.

    -
    |[ 0,0 ][ 1,0 ]         |
    -|[         2,0         ]|
    -
    - -

    A section with a non-zero height header will always cause that section to newline. Headers are always stretched to the -width of the collection view, pinched with the section insets.

    - -

    Ex. of a section (2,0) with a header inset on the left/right.

    -
    |[ 0,0 ][ 1,0 ]         |
    -| >======header=======< |
    -| [ 2,0 ]               |
    -
    - -

    Section insets apply to items in the section no matter if they begin on a new row or are on the same row as a previous -section.

    - -

    Ex. of a section (2) with multiple items and a left inset.

    -
    |[ 0,0 ][ 1,0 ] >[ 2,0 ]|
    -| >[ 2,1 ][ 2,2 ][ 2,3 ]|
    -
    - -

    Interitem spacing applies to items and sections within the same row. Line spacing only applies to items within the same -section.

    - -

    In a horizontally scrolling layout, sections and items are flowed vertically until they need to be newlined to the -next column. Headers, if used, are stretched to the height of the collection view, minus the section insets.

    +

    IGListAdapter objects provide an abstraction for feeds of objects in a UICollectionView by breaking each object +into individual sections, called section controllers. These controllers (objects subclassing to +IGListSectionController) act as a data source and delegate for each section.

    -

    Please see the unit tests for more configuration examples and expected output.

    +

    Feed implementations must act as the data source for an IGListAdapter in order to drive the objects and section +controllers in a collection view.

    - See more + See more

    Declaration

    Objective-C

    
    -@interface IGListCollectionViewLayout : UICollectionViewLayout
    +@interface IGListAdapter : NSObject

    Swift

    -
    class ListCollectionViewLayout : UICollectionViewLayout
    +
    class ListAdapter : NSObject
    @@ -582,9 +516,9 @@

    Declaration

  • @@ -592,22 +526,29 @@

    Declaration

    -

    This class adds a helper layer to IGListSectionController to automatically store a generic object in -didUpdateToObject:.

    +

    An IGListAdapterUpdater is a concrete type that conforms to IGListUpdatingDelegate. +It is an out-of-box updater for IGListAdapter objects to use.

    +
    +

    Note

    + This updater performs re-entrant, coalesced updating for a list. It also uses a least-minimal diff +for calculating UI updates when IGListAdapter calls +-performUpdateWithCollectionView:fromObjects:toObjects:completion:. - See more +
    + + See more

    Declaration

    Objective-C

    
    -@interface IGListGenericSectionController <__covariant ObjectType> : IGListSectionController
    +@interface IGListAdapterUpdater : NSObject <IGListUpdatingDelegate>

    Swift

    -
    class ListGenericSectionController<ObjectType> : ListSectionController where ObjectType : AnyObject
    +
    class ListAdapterUpdater : NSObject, ListUpdatingDelegate
    @@ -621,9 +562,9 @@

    Declaration

  • @@ -631,21 +572,42 @@

    Declaration

    -

    A result object returned when diffing with sections.

    +

    This section controller uses a data source to transform its top level object into an array of diffable view models. +It then automatically binds each view model to cells via the IGListBindable protocol.

    - See more +

    Models used with IGListBindingSectionController should take special care to always return YES for identical +objects. That is, any objects with matching -diffIdentifiers should always be equal, that way the section controller +can create new view models via the data source, create a diff, and update the specific cells that have changed.

    + +

    In Objective-C, your -isEqualToDiffableObject: can simply be:

    +
    - (BOOL)isEqualToDiffableObject:(id)object {
    +  return YES;
    +}
    +
    + +

    In Swift:

    +
    func isEqual(toDiffableObject object: IGListDiffable?) -> Bool {
    +  return true
    +}
    +
    + +

    Only when -diffIdentifiers match is object equality compared, so you can assume the class is the same, and the +instance has already been checked.

    + + See more

    Declaration

    Objective-C

    
    -@interface IGListIndexPathResult : NSObject
    +@interface IGListBindingSectionController< + __covariant ObjectType : id <IGListDiffable>> : IGListSectionController

    Swift

    -
    class ListIndexPathResult : NSObject
    +
    class ListBindingSectionController<ObjectType> : ListSectionController where ObjectType : ListDiffable
    @@ -659,9 +621,9 @@

    Declaration

  • @@ -669,21 +631,30 @@

    Declaration

    -

    A result object returned when diffing with indexes.

    +

    This UICollectionView subclass allows for partial layout invalidation using IGListCollectionViewLayout, +or custom layout classes that conform to IGListCollectionViewLayoutCompatible.

    +
    +

    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. IGListCollectionView gives IGListCollectionViewLayout the +missing information to re-calculate only the modified layout attributes. - See more +
    + + See more

    Declaration

    Objective-C

    
    -@interface IGListIndexSetResult : NSObject
    +@interface IGListCollectionView : UICollectionView

    Swift

    -
    class ListIndexSetResult : NSObject
    +
    class ListCollectionView : UICollectionView
    @@ -697,9 +668,9 @@

    Declaration

  • @@ -707,21 +678,73 @@

    Declaration

    -

    An object representing a move between indexes.

    +

    This UICollectionViewLayout subclass is for vertically or horizontally scrolling lists of data with variable widths and +heights. It supports an infinite number of sections and items. All work is done on the main thread, and while extremely efficient, +care must be taken not to stall the main thread in sizing delegate methods.

    - See more +

    This layout piggybacks on the mechanics of UICollectionViewFlowLayout in that:

    + +
      +
    • Your UICollectionView data source must also conform to UICollectionViewDelegateFlowLayout
    • +
    • Header support given via UICollectionElementKindSectionHeader
    • +
    + +

    All UICollectionViewDelegateFlowLayout methods are required and used by this layout:

    +
    - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
    +- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section;
    +- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section;
    +- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section;
    +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section;
    +
    + +

    In a vertically scrolling layout, sections and items are put into the same horizontal row until the max-x position +of an item extends beyond the width of the collection view. When that happens, the item is newlined to the next row. +The y position of that row is determined by the maximum height (including section insets) of the section/item of the previous row.

    + +

    Ex. of a section (2,0) with a large width causing a newline.

    +
    |[ 0,0 ][ 1,0 ]         |
    +|[         2,0         ]|
    +
    + +

    A section with a non-zero height header will always cause that section to newline. Headers are always stretched to the +width of the collection view, pinched with the section insets.

    + +

    Ex. of a section (2,0) with a header inset on the left/right.

    +
    |[ 0,0 ][ 1,0 ]         |
    +| >======header=======< |
    +| [ 2,0 ]               |
    +
    + +

    Section insets apply to items in the section no matter if they begin on a new row or are on the same row as a previous +section.

    + +

    Ex. of a section (2) with multiple items and a left inset.

    +
    |[ 0,0 ][ 1,0 ] >[ 2,0 ]|
    +| >[ 2,1 ][ 2,2 ][ 2,3 ]|
    +
    + +

    Interitem spacing applies to items and sections within the same row. Line spacing only applies to items within the same +section.

    + +

    In a horizontally scrolling layout, sections and items are flowed vertically until they need to be newlined to the +next column. Headers, if used, are stretched to the height of the collection view, minus the section insets.

    + +

    Please see the unit tests for more configuration examples and expected output.

    + + See more

    Declaration

    Objective-C

    
    -@interface IGListMoveIndex : NSObject
    +@interface IGListCollectionViewLayout + : UICollectionViewLayout <IGListCollectionViewLayoutCompatible>

    Swift

    -
    class ListMoveIndex : NSObject
    +
    class ListCollectionViewLayout : UICollectionViewLayout, ListCollectionViewLayoutCompatible
    @@ -735,9 +758,9 @@

    Declaration

  • @@ -745,21 +768,23 @@

    Declaration

    -

    An object representing a move between indexes.

    +

    This class adds a helper layer to IGListSectionController to automatically store a generic object in +didUpdateToObject:.

    - See more + See more

    Declaration

    Objective-C

    
    -@interface IGListMoveIndexPath : NSObject
    +@interface IGListGenericSectionController<__covariant ObjectType> + : IGListSectionController

    Swift

    -
    class ListMoveIndexPath : NSObject
    +
    class ListGenericSectionController<ObjectType> : ListSectionController where ObjectType : AnyObject
    @@ -889,56 +914,11 @@

    Declaration

  • -
    -
      -
    • - -
      -
      -
      -
      -
      -

      An instance of IGListStackedSectionController is a clustered section controller, composed of many child section -controllers. It constructs and routes item-level indexes to the appropriate child section controller with a local -index. This lets you build section controllers made up of individual units that can be shared and reused with other -section controllers.

      - -

      For example, you can create a Comments section controller that displays lists of text that is used alongside photo, -video, or slideshow section controllers. You then have four small and manageable section controllers instead of one -huge class.

      - - See more -
      -
      -

      Declaration

      -
      -

      Objective-C

      -
      
      -@interface IGListStackedSectionController : IGListSectionController
      - -
      -
      -

      Swift

      -
      class ListStackedSectionController : ListSectionController
      - -
      -
      -
      -
      -
    • -
    -
  • diff --git a/docs/Classes/IGListAdapter.html b/docs/Classes/IGListAdapter.html index 85904a90c..f4c0cc8b9 100644 --- a/docs/Classes/IGListAdapter.html +++ b/docs/Classes/IGListAdapter.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -262,8 +279,8 @@

    IGListAdapter

    -

    IGListAdapter objects provide an abstraction for feeds of objects in a UICollectionView by breaking each object -into individual sections, called section controllers. These controllers (objects subclassing to +

    IGListAdapter objects provide an abstraction for feeds of objects in a UICollectionView by breaking each object +into individual sections, called section controllers. These controllers (objects subclassing to IGListSectionController) act as a data source and delegate for each section.

    Feed implementations must act as the data source for an IGListAdapter in order to drive the objects and section @@ -400,7 +417,7 @@

    Declaration

    Swift

    -
    weak var delegate: IGListAdapterDelegate? { get set }
    +
    weak var delegate: ListAdapterDelegate? { get set }
    @@ -516,6 +533,39 @@

    Declaration

    +
  • +
    + + + + performanceDelegate + +
    +
    +
    +
    +
    +
    +

    The object that receives IGListAdapterPerformanceDelegate events to measure performance.

    + +
    +
    +

    Declaration

    +
    +

    Objective-C

    +
    @property (readwrite, nonatomic, nullable) id<IGListAdapterPerformanceDelegate>
    +    performanceDelegate;
    + +
    +
    +

    Swift

    +
    weak var performanceDelegate: ListAdapterPerformanceDelegate? { get set }
    + +
    +
    +
    +
    +
  • @@ -607,9 +657,9 @@

    Declaration

    Objective-C

    - (nonnull instancetype)
    - initWithUpdater:(nonnull id<IGListUpdatingDelegate>)updater
    -  viewController:(nullable UIViewController *)viewController
    -workingRangeSize:(NSInteger)workingRangeSize;
    + initWithUpdater:(nonnull id<IGListUpdatingDelegate>)updater + viewController:(nullable UIViewController *)viewController + workingRangeSize:(NSInteger)workingRangeSize;
    @@ -684,8 +734,8 @@

    Declaration

    Objective-C

    - (nonnull instancetype)
    -initWithUpdater:(nonnull id<IGListUpdatingDelegate>)updater
    - viewController:(nullable UIViewController *)viewController;
    + initWithUpdater:(nonnull id<IGListUpdatingDelegate>)updater + viewController:(nullable UIViewController *)viewController;
    @@ -749,7 +799,7 @@

    Declaration

    Objective-C

    - (void)performUpdatesAnimated:(BOOL)animated
    -                    completion:(nullable IGListUpdaterCompletion)completion;
    + completion:(nullable IGListUpdaterCompletion)completion;
    @@ -818,7 +868,7 @@

    Parameters

    Declaration

    Objective-C

    -
    - (void)reloadDataWithCompletion:(nullable IGListUpdaterCompletion)completion;
    +
    - (void)reloadDataWithCompletion:(nullable IGListUpdaterCompletion)completion;
    @@ -1432,7 +1482,7 @@

    Declaration

    Swift

    -
    func scroll(to object: Any, supplementaryKinds: [String]?, scrollDirection: UICollectionViewScrollDirection, scrollPosition: UICollectionViewScrollPosition, animated: Bool)
    +
    func scroll(to object: Any, supplementaryKinds: [String]?, scrollDirection: UICollectionView.ScrollDirection, scrollPosition: UICollectionView.ScrollPosition, animated: Bool)
    @@ -1743,8 +1793,8 @@

    Parameters

  • diff --git a/docs/Classes/IGListAdapterUpdater.html b/docs/Classes/IGListAdapterUpdater.html index c0ec0464c..7c34e112c 100644 --- a/docs/Classes/IGListAdapterUpdater.html +++ b/docs/Classes/IGListAdapterUpdater.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -344,9 +361,9 @@

    Declaration

  • - - - allowsBackgroundReloading + + + preferItemReloadsForSectionReloads
    @@ -354,31 +371,28 @@

    Declaration

    -

    A flag indicating whether this updater should skip diffing and simply call -reloadData for updates when the collection view is not in a window. The default value is YES.

    +

    A flag indicating that section reloads should be treated as item reloads, instead of converting them to delete, then insert operations. +This only applies if the number of items for the section is unchanged.

    Note

    -

    This will result in better performance, but will not generate the same delegate -callbacks. If using a custom layout, it will not receive prepareForCollectionViewUpdates:.

    + If the number of items for the section is changed, we would fallback to the default behavior and convert it to delete + insert, +because the collectionView can crash otherwise.
    -
    -

    Warning

    -

    On iOS < 8.3, this behavior is unsupported and will always be treated as NO.

    -
    +

    Default is NO.

    Declaration

    Objective-C

    -
    @property (assign, readwrite, nonatomic) BOOL allowsBackgroundReloading;
    +
    @property (assign, readwrite, nonatomic) BOOL preferItemReloadsForSectionReloads;

    Swift

    -
    var allowsBackgroundReloading: Bool { get set }
    +
    var preferItemReloadsForSectionReloads: Bool { get set }
    @@ -388,9 +402,9 @@

    Declaration

  • @@ -398,19 +412,31 @@

    Declaration

    -

    Time, in seconds, to wait and coalesce batch updates. Default is 0.

    +

    A flag indicating whether this updater should skip diffing and simply call +reloadData for updates when the collection view is not in a window. The default value is YES.

    +
    +

    Note

    +

    This will result in better performance, but will not generate the same delegate +callbacks. If using a custom layout, it will not receive prepareForCollectionViewUpdates:.

    + +
    +
    +

    Warning

    +

    On iOS < 8.3, this behavior is unsupported and will always be treated as NO.

    + +

    Declaration

    Objective-C

    -
    @property (assign, readwrite, nonatomic) NSTimeInterval coalescanceTime;
    +
    @property (assign, readwrite, nonatomic) BOOL allowsBackgroundReloading;

    Swift

    -
    var coalescanceTime: TimeInterval { get set }
    +
    var allowsBackgroundReloading: Bool { get set }
    @@ -454,8 +480,8 @@

    Declaration

  • diff --git a/docs/Classes/IGListBatchUpdateData.html b/docs/Classes/IGListBatchUpdateData.html index abb8c8279..c1066ae4c 100644 --- a/docs/Classes/IGListBatchUpdateData.html +++ b/docs/Classes/IGListBatchUpdateData.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -433,6 +450,39 @@

    Declaration

    +
  • +
    + + + + updateIndexPaths + +
    +
    +
    +
    +
    +
    +

    Item update index paths.

    + +
    +
    +

    Declaration

    +
    +

    Objective-C

    +
    @property (readonly, strong, nonatomic)
    +    NSArray<NSIndexPath *> *_Nonnull updateIndexPaths;
    + +
    +
    +

    Swift

    +
    var updateIndexPaths: [IndexPath] { get }
    + +
    +
    +
    +
    +
  • @@ -469,9 +519,9 @@

    Declaration

  • - - - -initWithInsertSections:deleteSections:moveSections:insertIndexPaths:deleteIndexPaths:moveIndexPaths: + + + -initWithInsertSections:deleteSections:moveSections:insertIndexPaths:deleteIndexPaths:updateIndexPaths:moveIndexPaths:fixIndexPathImbalance:
    @@ -487,17 +537,20 @@

    Declaration

    Objective-C

    - (nonnull instancetype)
    -initWithInsertSections:(nonnull NSIndexSet *)insertSections
    -        deleteSections:(nonnull NSIndexSet *)deleteSections
    -          moveSections:(nonnull NSSet<IGListMoveIndex *> *)moveSections
    -      insertIndexPaths:(nonnull NSArray<NSIndexPath *> *)insertIndexPaths
    -      deleteIndexPaths:(nonnull NSArray<NSIndexPath *> *)deleteIndexPaths
    -        moveIndexPaths:(nonnull NSArray<IGListMoveIndexPath *> *)moveIndexPaths;
    + initWithInsertSections:(nonnull NSIndexSet *)insertSections + deleteSections:(nonnull NSIndexSet *)deleteSections + moveSections:(nonnull NSSet<IGListMoveIndex *> *)moveSections + insertIndexPaths:(nonnull NSArray<NSIndexPath *> *)insertIndexPaths + deleteIndexPaths:(nonnull NSArray<NSIndexPath *> *)deleteIndexPaths + updateIndexPaths:(nonnull NSArray<NSIndexPath *> *)updateIndexPaths + moveIndexPaths: + (nonnull NSArray<IGListMoveIndexPath *> *)moveIndexPaths + fixIndexPathImbalance:(BOOL)fixIndexPathImbalance;

    Swift

    -
    init(insertSections: IndexSet, deleteSections: IndexSet, moveSections: Set<ListMoveIndex>, insert insertIndexPaths: [IndexPath], delete deleteIndexPaths: [IndexPath], moveIndexPaths: [ListMoveIndexPath])
    +
    init(insertSections: IndexSet, deleteSections: IndexSet, moveSections: Set<ListMoveIndex>, insert insertIndexPaths: [IndexPath], delete deleteIndexPaths: [IndexPath], update updateIndexPaths: [IndexPath], moveIndexPaths: [ListMoveIndexPath], fixIndexPathImbalance: Bool)
    @@ -565,6 +618,18 @@

    Parameters

    + + + + updateIndexPaths + + + +
    +

    Item index paths to update.

    +
    + + @@ -577,6 +642,18 @@

    Parameters

    + + + + fixIndexPathImbalance + + + +
    +

    When enabled, we remove duplicate NSIndexPath inserts to avoid insert/delete imbalance and a crash.

    +
    + + @@ -587,13 +664,53 @@

    Return Value

  • +
  • +
    + + + + -initWithInsertSections:deleteSections:moveSections:insertIndexPaths:deleteIndexPaths:updateIndexPaths:moveIndexPaths: + +
    +
    +
    +
    +
    +
    +

    Convenience initializer with fixIndexPathImbalance disabled.

    + +
    +
    +

    Declaration

    +
    +

    Objective-C

    +
    - (nonnull instancetype)
    +    initWithInsertSections:(nonnull NSIndexSet *)insertSections
    +            deleteSections:(nonnull NSIndexSet *)deleteSections
    +              moveSections:(nonnull NSSet<IGListMoveIndex *> *)moveSections
    +          insertIndexPaths:(nonnull NSArray<NSIndexPath *> *)insertIndexPaths
    +          deleteIndexPaths:(nonnull NSArray<NSIndexPath *> *)deleteIndexPaths
    +          updateIndexPaths:(nonnull NSArray<NSIndexPath *> *)updateIndexPaths
    +            moveIndexPaths:
    +                (nonnull NSArray<IGListMoveIndexPath *> *)moveIndexPaths;
    + +
    +
    +

    Swift

    +
    convenience init(insertSections: IndexSet, deleteSections: IndexSet, moveSections: Set<ListMoveIndex>, insert insertIndexPaths: [IndexPath], delete deleteIndexPaths: [IndexPath], update updateIndexPaths: [IndexPath], moveIndexPaths: [ListMoveIndexPath])
    + +
    +
    +
    +
    +
  • diff --git a/docs/Classes/IGListBindingSectionController.html b/docs/Classes/IGListBindingSectionController.html index 052084698..f9a611a91 100644 --- a/docs/Classes/IGListBindingSectionController.html +++ b/docs/Classes/IGListBindingSectionController.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -258,9 +275,8 @@

    IGListBindingSectionController

    
    -@interface IGListBindingSectionController < __covariant ObjectType
    -    : id <IGListDiffable>
    -> : IGListSectionController @end
    +@interface IGListBindingSectionController< + __covariant ObjectType : id <IGListDiffable>> : IGListSectionController
    @@ -315,6 +331,11 @@

    Declaration

    dataSource; +
    +

    Swift

    +
    weak var dataSource: ListBindingSectionControllerDataSource? { get set }
    + +
    @@ -344,6 +365,11 @@

    Declaration

    selectionDelegate; +
    +

    Swift

    +
    weak var selectionDelegate: ListBindingSectionControllerSelectionDelegate? { get set }
    + +
    @@ -371,6 +397,11 @@

    Declaration

    @property (readonly, strong, nonatomic, nullable) ObjectType object;
    +
    +

    Swift

    +
    var object: ObjectType? { get }
    + +
    @@ -400,6 +431,11 @@

    Declaration

    NSArray<id<IGListDiffable>> *_Nonnull viewModels; +
    +

    Swift

    +
    var viewModels: [ListDiffable] { get }
    + +
    @@ -428,6 +464,11 @@

    Declaration

    completion:(nullable void (^)(BOOL))completion; +
    +

    Swift

    +
    func update(animated: Bool, completion: ((Bool) -> Void)? = nil)
    + +

    Parameters

    @@ -463,13 +504,82 @@

    Parameters

    +
  • +
    + + + + -moveObjectFromIndex:toIndex: + +
    +
    +
    +
    +
    +
    +

    Notifies the section that a list object should move within a section as the result of interactive reordering.

    +
    +

    Note

    +

    this method must be implemented if interactive reordering is enabled. To ensure updating the internal viewModels array, calling super is required, preferably before your own implementation.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Objective-C

    +
    - (void)moveObjectFromIndex:(NSInteger)sourceIndex
    +                    toIndex:(NSInteger)destinationIndex;
    + +
    +
    +

    Swift

    +
    func moveObject(from sourceIndex: Int, to destinationIndex: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sourceIndex + + +
    +

    The starting index of the object.

    +
    +
    + + destinationIndex + + +
    +

    The ending index of the object.

    +
    +
    +
    +
    +
    +
  • diff --git a/docs/Classes/IGListCollectionView.html b/docs/Classes/IGListCollectionView.html index e9c0c0bbb..6688ae1c9 100644 --- a/docs/Classes/IGListCollectionView.html +++ b/docs/Classes/IGListCollectionView.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -262,7 +279,8 @@

    IGListCollectionView

    -

    This UICollectionView subclass allows for partial layout invalidation using IGListCollectionViewLayout.

    +

    This UICollectionView subclass allows for partial layout invalidation using IGListCollectionViewLayout, +or custom layout classes that conform to IGListCollectionViewLayoutCompatible.

    Note

    When updating a collection view (ex: calling -insertSections), -invalidateLayoutWithContext gets called on @@ -301,14 +319,11 @@

    IGListCollectionView

    Declaration

    Objective-C

    -
    - (nonnull instancetype)initWithFrame:(CGRect)frame
    -             listCollectionViewLayout:
    -                 (nonnull IGListCollectionViewLayout *)collectionViewLayout;
    - -
    -
    -

    Swift

    -
    init(frame: CGRect, listCollectionViewLayout collectionViewLayout: IGListCollectionViewLayout)
    +
    - (nonnull instancetype)
    +               initWithFrame:(CGRect)frame
    +    listCollectionViewLayout:
    +        (nonnull UICollectionViewLayout<IGListCollectionViewLayoutCompatible> *)
    +            collectionViewLayout;
    @@ -336,7 +351,8 @@

    Parameters

    -

    The layout to use with the collection view.

    +

    The layout to use with the collection view. You can use IGListCollectionViewLayout +here, or a custom layout class that conforms to IGListCollectionViewLayoutCompatible.

    @@ -351,8 +367,8 @@

    Parameters

    diff --git a/docs/Classes/IGListCollectionViewLayout.html b/docs/Classes/IGListCollectionViewLayout.html index 429e788da..6a792d7da 100644 --- a/docs/Classes/IGListCollectionViewLayout.html +++ b/docs/Classes/IGListCollectionViewLayout.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -258,7 +275,8 @@

    IGListCollectionViewLayout

    
    -@interface IGListCollectionViewLayout : UICollectionViewLayout
    +@interface IGListCollectionViewLayout + : UICollectionViewLayout <IGListCollectionViewLayoutCompatible>
    @@ -345,7 +363,7 @@

    Declaration

    Swift

    -
    var scrollDirection: UICollectionViewScrollDirection { get }
    +
    var scrollDirection: UICollectionView.ScrollDirection { get }
    @@ -426,9 +444,9 @@

    Declaration

  • - - - -didModifySection: + + + experiments
    @@ -436,49 +454,22 @@

    Declaration

    -

    Notify the layout that a specific section was modified before invalidation. 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. We can use this method to keep track of which section actually -needs to be updated on the following -invalidateLayoutWithContext. See IGListCollectionView.

    - -
    +

    A bitmask of experiments to conduct on the adapter.

    Declaration

    Objective-C

    -
    - (void)didModifySection:(NSInteger)modifiedSection;
    +
    @property (assign, readwrite, nonatomic) IGListExperiment experiments;

    Swift

    -
    func didModifySection(_ modifiedSection: Int)
    +
    var experiments: IGListExperiment { get set }
    -
    -

    Parameters

    - - - - - - - -
    - - modifiedSection - - -
    -

    The section that was modified.

    -
    -
    -
  • @@ -503,15 +494,15 @@

    Declaration

    Objective-C

    - (nonnull instancetype)
    -initWithStickyHeaders:(BOOL)stickyHeaders
    -      scrollDirection:(UICollectionViewScrollDirection)scrollDirection
    -      topContentInset:(CGFloat)topContentInset
    -        stretchToEdge:(BOOL)stretchToEdge;
    + initWithStickyHeaders:(BOOL)stickyHeaders + scrollDirection:(UICollectionViewScrollDirection)scrollDirection + topContentInset:(CGFloat)topContentInset + stretchToEdge:(BOOL)stretchToEdge;

    Swift

    -
    init(stickyHeaders: Bool, scrollDirection: UICollectionViewScrollDirection, topContentInset: CGFloat, stretchToEdge: Bool)
    +
    init(stickyHeaders: Bool, scrollDirection: UICollectionView.ScrollDirection, topContentInset: CGFloat, stretchToEdge: Bool)
    @@ -663,8 +654,8 @@

    Return Value

    diff --git a/docs/Classes/IGListGenericSectionController.html b/docs/Classes/IGListGenericSectionController.html index c719bf042..3637ddfdb 100644 --- a/docs/Classes/IGListGenericSectionController.html +++ b/docs/Classes/IGListGenericSectionController.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -258,7 +275,8 @@

    IGListGenericSectionController

    
    -@interface IGListGenericSectionController <__covariant ObjectType> : IGListSectionController
    +@interface IGListGenericSectionController<__covariant ObjectType> + : IGListSectionController
    @@ -370,8 +388,8 @@

    Parameters

    diff --git a/docs/Classes/IGListIndexPathResult.html b/docs/Classes/IGListIndexPathResult.html index 874e6dafb..53d09d737 100644 --- a/docs/Classes/IGListIndexPathResult.html +++ b/docs/Classes/IGListIndexPathResult.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -589,8 +606,8 @@

    Declaration

    diff --git a/docs/Classes/IGListIndexSetResult.html b/docs/Classes/IGListIndexSetResult.html index 34bdd480a..5c8721061 100644 --- a/docs/Classes/IGListIndexSetResult.html +++ b/docs/Classes/IGListIndexSetResult.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -586,8 +603,8 @@

    Declaration

    diff --git a/docs/Classes/IGListMoveIndex.html b/docs/Classes/IGListMoveIndex.html index 2477ea911..aa6905b8a 100644 --- a/docs/Classes/IGListMoveIndex.html +++ b/docs/Classes/IGListMoveIndex.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -337,8 +354,8 @@

    Declaration

    diff --git a/docs/Classes/IGListMoveIndexPath.html b/docs/Classes/IGListMoveIndexPath.html index 36a61e078..99eb709a4 100644 --- a/docs/Classes/IGListMoveIndexPath.html +++ b/docs/Classes/IGListMoveIndexPath.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -337,8 +354,8 @@

    Declaration

    diff --git a/docs/Classes/IGListSectionController.html b/docs/Classes/IGListSectionController.html index 89ffae597..cab547294 100644 --- a/docs/Classes/IGListSectionController.html +++ b/docs/Classes/IGListSectionController.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -394,6 +411,13 @@

    Return Value

    one of the dequeue methods on the IGListCollectionContext. The default implementation will assert. You must override this method without calling super.

    + +
    +

    Warning

    +

    Don’t call this method to obtain a reference to currently dequeued cells: a new cell will be dequeued +and returned, rather than the existing cell that you may have intended to retrieve. Instead, you can call +-cellForItemAtIndex:sectionController: on IGListCollectionContext to obtain active cell references.

    +
    @@ -765,13 +789,17 @@

    Parameters

    -

    The index of the unhighlighted cell.

    +

    The index of the object in the list.

    +
    +

    Return Value

    +

    YES if the object is allowed to move, otherwise NO.

    +
    @@ -1350,8 +1378,8 @@

    Return Value

    diff --git a/docs/Classes/IGListSingleSectionController.html b/docs/Classes/IGListSingleSectionController.html index 51d8991ad..de2fa3486 100644 --- a/docs/Classes/IGListSingleSectionController.html +++ b/docs/Classes/IGListSingleSectionController.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -297,9 +314,10 @@

    Declaration

    Objective-C

    - (nonnull instancetype)
    -initWithCellClass:(nonnull Class)cellClass
    -   configureBlock:(nonnull IGListSingleSectionCellConfigureBlock)configureBlock
    -        sizeBlock:(nonnull IGListSingleSectionCellSizeBlock)sizeBlock;
    + initWithCellClass:(nonnull Class)cellClass + configureBlock: + (nonnull IGListSingleSectionCellConfigureBlock)configureBlock + sizeBlock:(nonnull IGListSingleSectionCellSizeBlock)sizeBlock;
    @@ -385,10 +403,11 @@

    Declaration

    Objective-C

    - (nonnull instancetype)
    -initWithNibName:(nonnull NSString *)nibName
    -         bundle:(nullable NSBundle *)bundle
    - configureBlock:(nonnull IGListSingleSectionCellConfigureBlock)configureBlock
    -      sizeBlock:(nonnull IGListSingleSectionCellSizeBlock)sizeBlock;
    + initWithNibName:(nonnull NSString *)nibName + bundle:(nullable NSBundle *)bundle + configureBlock: + (nonnull IGListSingleSectionCellConfigureBlock)configureBlock + sizeBlock:(nonnull IGListSingleSectionCellSizeBlock)sizeBlock;
    @@ -486,11 +505,12 @@

    Declaration

    Objective-C

    - (nonnull instancetype)
    -initWithStoryboardCellIdentifier:(nonnull NSString *)identifier
    -                  configureBlock:(nonnull IGListSingleSectionCellConfigureBlock)
    -                                     configureBlock
    -                       sizeBlock:
    -                           (nonnull IGListSingleSectionCellSizeBlock)sizeBlock;
    + initWithStoryboardCellIdentifier:(nonnull NSString *)identifier + configureBlock: + (nonnull IGListSingleSectionCellConfigureBlock) + configureBlock + sizeBlock:(nonnull IGListSingleSectionCellSizeBlock) + sizeBlock;
    @@ -588,8 +608,8 @@

    Declaration

    diff --git a/docs/Constants.html b/docs/Constants.html index 60c8f8733..bca8145f6 100644 --- a/docs/Constants.html +++ b/docs/Constants.html @@ -10,6 +10,7 @@ +
    diff --git a/docs/Enums.html b/docs/Enums.html index 9aefe4764..6fc6e940f 100644 --- a/docs/Enums.html +++ b/docs/Enums.html @@ -10,6 +10,7 @@ +
    @@ -34,7 +35,7 @@ Best Practices and FAQ - + @@ -173,6 +174,9 @@ + @@ -200,31 +204,37 @@ @@ -248,6 +258,14 @@ +
    @@ -263,9 +281,9 @@

    Enumerations

  • @@ -273,20 +291,20 @@

    Enumerations

    -

    The type of update that was performed by an IGListAdapter.

    +

    An option for how to do comparisons between similar objects.

    - See more + See more

    Declaration

    Objective-C

    -
    enum IGListAdapterUpdateType {}
    +
    enum IGListDiffOption {}

    Swift

    -
    enum IGListAdapterUpdateType : Int
    +
    enum IGListDiffOption : Int
    @@ -300,9 +318,9 @@

    Declaration

  • @@ -310,20 +328,20 @@

    Declaration

    -

    An option for how to do comparisons between similar objects.

    +

    Bitmask-able options used for pre-release feature testing.

    - See more + See more

    Declaration

    Objective-C

    -
    enum IGListDiffOption {}
    +
    enum IGListExperiment {}

    Swift

    -
    enum IGListDiffOption : Int
    +
    struct IGListExperiment : OptionSet
    @@ -337,9 +355,9 @@

    Declaration

  • @@ -347,20 +365,20 @@

    Declaration

    -

    Bitmask-able options used for pre-release feature testing.

    +

    The type of update that was performed by an IGListAdapter.

    - See more + See more

    Declaration

    Objective-C

    -
    enum IGListExperiment {}
    +
    enum IGListAdapterUpdateType {}

    Swift

    -
    struct IGListExperiment : OptionSet
    +
    enum IGListAdapterUpdateType : Int
    @@ -372,8 +390,8 @@

    Declaration

  • diff --git a/docs/Enums/IGListAdapterUpdateType.html b/docs/Enums/IGListAdapterUpdateType.html index 95d0b443f..d6903239c 100644 --- a/docs/Enums/IGListAdapterUpdateType.html +++ b/docs/Enums/IGListAdapterUpdateType.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ + diff --git a/docs/Enums/IGListDiffOption.html b/docs/Enums/IGListDiffOption.html index 8fab459e9..f67ff4c48 100644 --- a/docs/Enums/IGListDiffOption.html +++ b/docs/Enums/IGListDiffOption.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ + diff --git a/docs/Enums/IGListExperiment.html b/docs/Enums/IGListExperiment.html index 03db1cca3..74c0179f8 100644 --- a/docs/Enums/IGListExperiment.html +++ b/docs/Enums/IGListExperiment.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -366,9 +383,9 @@

    Declaration

  • @@ -376,19 +393,19 @@

    Declaration

    -

    Test a faster way to return visible section controllers.

    +

    Test removing the layout pass when calling scrollToObject to avoid creating off-screen cells.

    Declaration

    Objective-C

    -
    IGListExperimentFasterVisibleSectionController = 1 << 4
    +
    IGListExperimentAvoidLayoutOnScrollToObject = 1 << 4

    Swift

    -
    static var fasterVisibleSectionController: IGListExperiment { get }
    +
    static var avoidLayoutOnScrollToObject: IGListExperiment { get }
    @@ -398,9 +415,9 @@

    Declaration

  • @@ -408,19 +425,19 @@

    Declaration

    -

    Test deduping item-level updates.

    +

    Test fixing a crash when inserting and deleting the same NSIndexPath multiple times.

    Declaration

    Objective-C

    -
    IGListExperimentDedupeItemUpdates = 1 << 5
    +
    IGListExperimentFixIndexPathImbalance = 1 << 5

    Swift

    -
    static var dedupeItemUpdates: IGListExperiment { get }
    +
    static var fixIndexPathImbalance: IGListExperiment { get }
    @@ -459,13 +476,109 @@

    Declaration

  • +
  • + +
    +
    +
    +
    +
    +

    Test getting collection view at update time.

    + +
    +
    +

    Declaration

    +
    +

    Objective-C

    +
    IGListExperimentGetCollectionViewAtUpdate = 1 << 7
    + +
    +
    +

    Swift

    +
    static var getCollectionViewAtUpdate: IGListExperiment { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Test invalidating layout when cell reloads/updates in IGListBindingSectionController.

    + +
    +
    +

    Declaration

    +
    +

    Objective-C

    +
    IGListExperimentInvalidateLayoutForUpdates = 1 << 8
    + +
    +
    +

    Swift

    +
    static var invalidateLayoutForUpdates: IGListExperiment { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Test using the collection view when asking for layout instead of accessing the data source. Only apply to IGListCollectionViewLayout.

    + +
    +
    +

    Declaration

    +
    +

    Objective-C

    +
    IGListExperimentUseCollectionViewInsteadOfDataSourceInLayout = 1 << 9
    + +
    +
    +

    Swift

    +
    static var useCollectionViewInsteadOfDataSourceInLayout: IGListExperiment { get }
    + +
    +
    +
    +
    +
  • diff --git a/docs/Functions.html b/docs/Functions.html index 62164af23..79105d9c7 100644 --- a/docs/Functions.html +++ b/docs/Functions.html @@ -10,6 +10,7 @@ +
    diff --git a/docs/Guides.html b/docs/Guides.html index ec462aaeb..4e022785f 100644 --- a/docs/Guides.html +++ b/docs/Guides.html @@ -10,6 +10,7 @@ +
    @@ -34,7 +35,7 @@ Best Practices and FAQ - + @@ -173,6 +174,9 @@ + @@ -200,31 +204,37 @@ @@ -248,6 +258,14 @@ +
    @@ -258,11 +276,141 @@

    Guides

    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    diff --git a/docs/Protocols.html b/docs/Protocols.html index 361a0a168..f789b2034 100644 --- a/docs/Protocols.html +++ b/docs/Protocols.html @@ -10,6 +10,7 @@ +
    @@ -34,7 +35,7 @@ Best Practices and FAQ - + @@ -173,6 +174,9 @@ + @@ -200,31 +204,37 @@ @@ -248,6 +258,14 @@ +
    @@ -258,6 +276,43 @@

    Protocols

    +
    +
      +
    • +
      + + + + IGListDiffable + +
      +
      +
      +
      +
      +
      +

      The IGListDiffable protocol provides methods needed to compare the identity and equality of two objects.

      + + See more +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      @protocol IGListDiffable
      + +
      +
      +

      Swift

      +
      protocol ListDiffable
      + +
      +
      +
      +
      +
    • +
    +
    • @@ -323,7 +378,7 @@

      Declaration

    Swift

    -
    protocol IGListAdapterDelegate : NSObjectProtocol
    +
    protocol ListAdapterDelegate : NSObjectProtocol
    @@ -369,6 +424,43 @@

    Declaration

    +
    +
      +
    • + +
      +
      +
      +
      +
      +

      IGListAdapterPerformanceDelegate can be used to measure cell dequeue, display, size, and scroll callbacks.

      + + See more +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      @protocol IGListAdapterPerformanceDelegate <NSObject>
      + +
      +
      +

      Swift

      +
      protocol ListAdapterPerformanceDelegate : NSObjectProtocol
      + +
      +
      +
      +
      +
    • +
    +
    + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    diff --git a/docs/Protocols/IGListAdapterDelegate.html b/docs/Protocols/IGListAdapterDelegate.html index eb3ebcea7..30149598e 100644 --- a/docs/Protocols/IGListAdapterDelegate.html +++ b/docs/Protocols/IGListAdapterDelegate.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ + diff --git a/docs/Protocols/IGListAdapterMoveDelegate.html b/docs/Protocols/IGListAdapterMoveDelegate.html index 588271ae2..23cf24ac3 100644 --- a/docs/Protocols/IGListAdapterMoveDelegate.html +++ b/docs/Protocols/IGListAdapterMoveDelegate.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ + diff --git a/docs/Protocols/IGListAdapterPerformanceDelegate.html b/docs/Protocols/IGListAdapterPerformanceDelegate.html new file mode 100644 index 000000000..d56b167af --- /dev/null +++ b/docs/Protocols/IGListAdapterPerformanceDelegate.html @@ -0,0 +1,981 @@ + + + + IGListAdapterPerformanceDelegate Protocol Reference + + + + + + + + + + +
    +
    +

    IGListKit Docs (98% documented)

    +

    View on GitHub

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    IGListAdapterPerformanceDelegate

    +
    +
    +
    @protocol IGListAdapterPerformanceDelegate <NSObject>
    + +
    +
    +

    IGListAdapterPerformanceDelegate can be used to measure cell dequeue, display, size, and scroll callbacks.

    + +
    +
    +
    +
      +
    • + +
      +
      +
      +
      +
      +

      Will call -[IGListAdapter collectionView:cellForItemAtIndexPath:].

      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      - (void)listAdapterWillCallDequeueCell:(nonnull IGListAdapter *)listAdapter;
      + +
      +
      +

      Swift

      +
      func listAdapterWillCallDequeueCell(_ listAdapter: IGListAdapter)
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + listAdapter + + +
      +

      The list adapter sending this information.

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Did finish calling -[IGListAdapter collectionView:cellForItemAtIndexPath:].

      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      - (void)listAdapter:(nonnull IGListAdapter *)listAdapter
      +     didCallDequeueCell:(nonnull UICollectionViewCell *)cell
      +    onSectionController:(nonnull IGListSectionController *)sectionController
      +                atIndex:(NSInteger)index;
      + +
      +
      +

      Swift

      +
      func listAdapter(_ listAdapter: IGListAdapter, didCallDequeueCell cell: Any!, on sectionController: IGListSectionController, at index: Int)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + + + + + + + + + +
      + + listAdapter + + +
      +

      The list adapter sending this information.

      +
      +
      + + cell + + +
      +

      A cell that was dequeued.

      +
      +
      + + sectionController + + +
      +

      The section controller providing the cell.

      +
      +
      + + index + + +
      +

      Item index of the cell.

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Will call -[IGListAdapter collectionView:willDisplayCell:forItemAtIndexPath:].

      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      - (void)listAdapterWillCallDisplayCell:(nonnull IGListAdapter *)listAdapter;
      + +
      +
      +

      Swift

      +
      func listAdapterWillCallDisplayCell(_ listAdapter: IGListAdapter)
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + listAdapter + + +
      +

      The list adapter sending this information.

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Did finish calling -[IGListAdapter collectionView:willDisplayCell:forItemAtIndexPath:].

      +
      +

      Note

      +

      Keep in mind this also includes calling the IGListAdapter‘s collectionViewDelegate and workingRangeHandler.

      + +
      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      - (void)listAdapter:(nonnull IGListAdapter *)listAdapter
      +     didCallDisplayCell:(nonnull UICollectionViewCell *)cell
      +    onSectionController:(nonnull IGListSectionController *)sectionController
      +                atIndex:(NSInteger)index;
      + +
      +
      +

      Swift

      +
      func listAdapter(_ listAdapter: IGListAdapter, didCallDisplayCell cell: Any!, on sectionController: IGListSectionController, at index: Int)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + + + + + + + + + +
      + + listAdapter + + +
      +

      The list adapter sending this information.

      +
      +
      + + cell + + +
      +

      A cell that will be displayed.

      +
      +
      + + sectionController + + +
      +

      The section controller for that cell.

      +
      +
      + + index + + +
      +

      Item index of the cell.

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Will call -[IGListAdapter collectionView:didEndDisplayingCell:forItemAtIndexPath:].

      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      - (void)listAdapterWillCallEndDisplayCell:(nonnull IGListAdapter *)listAdapter;
      + +
      +
      +

      Swift

      +
      func listAdapterWillCallEndDisplayCell(_ listAdapter: IGListAdapter)
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + listAdapter + + +
      +

      The list adapter sending this information.

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Did finish calling -[IGListAdapter collectionView:didEndDisplayingCell:forItemAtIndexPath:].

      +
      +

      Note

      +

      Keep in mind this also includes calling the IGListAdapter‘s collectionViewDelegate and workingRangeHandler.

      + +
      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      - (void)listAdapter:(nonnull IGListAdapter *)listAdapter
      +    didCallEndDisplayCell:(nonnull UICollectionViewCell *)cell
      +      onSectionController:(nonnull IGListSectionController *)sectionController
      +                  atIndex:(NSInteger)index;
      + +
      +
      +

      Swift

      +
      func listAdapter(_ listAdapter: IGListAdapter, didCallEndDisplayCell cell: Any!, on sectionController: IGListSectionController, at index: Int)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + + + + + + + + + +
      + + listAdapter + + +
      +

      The list adapter sending this information.

      +
      +
      + + cell + + +
      +

      A cell that was displayed.

      +
      +
      + + sectionController + + +
      +

      The section controller for that cell.

      +
      +
      + + index + + +
      +

      Item index of the cell.

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Will call -[IGListAdapter collectionView:collectionViewLayout:sizeForItemAtIndexPath:].

      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      - (void)listAdapterWillCallSize:(nonnull IGListAdapter *)listAdapter;
      + +
      +
      +

      Swift

      +
      func listAdapterWillCallSize(_ listAdapter: IGListAdapter)
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + listAdapter + + +
      +

      The list adapter sending this information.

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Did finish calling -[IGListAdapter collectionView:collectionViewLayout:sizeForItemAtIndexPath:].

      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      - (void)listAdapter:(nonnull IGListAdapter *)listAdapter
      +    didCallSizeOnSectionController:
      +        (nonnull IGListSectionController *)sectionController
      +                           atIndex:(NSInteger)index;
      + +
      +
      +

      Swift

      +
      func listAdapter(_ listAdapter: IGListAdapter, didCallSizeOn sectionController: IGListSectionController, at index: Int)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + + + + + +
      + + listAdapter + + +
      +

      The list adapter sending this information.

      +
      +
      + + sectionController + + +
      +

      The section controller providing the size.

      +
      +
      + + index + + +
      +

      Item index used to calculate the size.

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Will call -[IGListAdapter scrollViewDidScroll:].

      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      - (void)listAdapterWillCallScroll:(nonnull IGListAdapter *)listAdapter;
      + +
      +
      +

      Swift

      +
      func listAdapterWillCallScroll(_ listAdapter: IGListAdapter)
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + listAdapter + + +
      +

      The list adapter sending this information.

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Did finish calling -[IGListAdapter scrollViewDidScroll:].

      +
      +

      Note

      +

      Keep in mind this also includes calling the IGListAdapter‘s scrollViewDelegate and all visible IGListSectioControllers.

      + +
      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      - (void)listAdapter:(nonnull IGListAdapter *)listAdapter
      +      didCallScroll:(nonnull UIScrollView *)scrollView;
      + +
      +
      +

      Swift

      +
      func listAdapter(_ listAdapter: IGListAdapter, didCallScroll scrollView: Any!)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + listAdapter + + +
      +

      The list adapter sending this information.

      +
      +
      + + scrollView + + +
      +

      The scroll view backing the UICollectionView.

      +
      +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Protocols/IGListAdapterUpdateListener.html b/docs/Protocols/IGListAdapterUpdateListener.html index 124802ad5..f771a6df4 100644 --- a/docs/Protocols/IGListAdapterUpdateListener.html +++ b/docs/Protocols/IGListAdapterUpdateListener.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ + diff --git a/docs/Protocols/IGListAdapterUpdaterDelegate.html b/docs/Protocols/IGListAdapterUpdaterDelegate.html index faf009b9c..c56113a1a 100644 --- a/docs/Protocols/IGListAdapterUpdaterDelegate.html +++ b/docs/Protocols/IGListAdapterUpdaterDelegate.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -270,9 +287,9 @@

    IGListAdapterUpdaterDelegate

  • @@ -289,12 +306,15 @@

    Declaration

    Objective-C

    - (void)listAdapterUpdater:(nonnull IGListAdapterUpdater *)listAdapterUpdater
         willPerformBatchUpdatesWithCollectionView:
    -        (nonnull UICollectionView *)collectionView;
    - -
    -
    -

    Swift

    -
    func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, willPerformBatchUpdatesWith collectionView: UICollectionView)
    + (nonnull UICollectionView *)collectionView + fromObjects: + (nullable NSArray<id<IGListDiffable>> *) + fromObjects + toObjects: + (nullable NSArray<id<IGListDiffable>> *) + toObjects + listIndexSetResult:(nullable IGListIndexSetResult *) + listIndexSetResults;
    @@ -326,6 +346,42 @@

    Parameters

    + + + + fromObjects + + + +
    +

    The items transitioned from in the batch updates, if any.

    +
    + + + + + + toObjects + + + +
    +

    The items transitioned to in the batch updates, if any.

    +
    + + + + + + listIndexSetResults + + + +
    +

    The diffing result of indices to be inserted/removed/updated/moved/etc.

    +
    + + @@ -968,9 +1024,9 @@

    Parameters

  • @@ -990,12 +1046,13 @@

    Declaration

    willCrashWithException:(nonnull NSException *)exception fromObjects:(nullable NSArray *)fromObjects toObjects:(nullable NSArray *)toObjects + diffResult:(nonnull IGListIndexSetResult *)diffResult updates:(nonnull IGListBatchUpdateData *)updates;

    Swift

    -
    func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, collectionView: UICollectionView, willCrashWith exception: NSException, from fromObjects: [Any]?, to toObjects: [Any]?, updates: ListBatchUpdateData)
    +
    func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, collectionView: UICollectionView, willCrashWith exception: NSException, from fromObjects: [Any]?, to toObjects: [Any]?, diffResult: IGListIndexSetResult, updates: ListBatchUpdateData)
    @@ -1063,6 +1120,18 @@

    Parameters

    + + + + diffResult + + + +
    +

    The diff result that were computed from fromObjects and toObjects.

    +
    + + @@ -1086,8 +1155,8 @@

    Parameters

  • diff --git a/docs/Protocols/IGListBatchContext.html b/docs/Protocols/IGListBatchContext.html index fa8004a97..db0323383 100644 --- a/docs/Protocols/IGListBatchContext.html +++ b/docs/Protocols/IGListBatchContext.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -463,6 +480,71 @@

    Parameters

    +
  • + +
    +
    +
    +
    +
    +

    Invalidates layouts of cells at specific in the section controller.

    + +
    +
    +

    Declaration

    +
    +

    Objective-C

    +
    - (void)invalidateLayoutInSectionController:
    +            (nonnull IGListSectionController *)sectionController
    +                                  atIndexes:(nonnull NSIndexSet *)indexes;
    + +
    +
    +

    Swift

    +
    func invalidateLayout(in sectionController: IGListSectionController, at indexes: IndexSet)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sectionController + + +
    +

    The section controller who’s cells need invalidating.

    +
    +
    + + indexes + + +
    +

    The indexes of items that need invalidating.

    +
    +
    +
    +
    +
    +
  • @@ -769,10 +851,10 @@

    Parameters

    Declaration

    Objective-C

    -
    - (void)
    -revertInvalidInteractiveMoveFromIndexPath:(nonnull NSIndexPath *)sourceIndexPath
    -                              toIndexPath:
    -                                  (nonnull NSIndexPath *)destinationIndexPath;
    +
    - (void)revertInvalidInteractiveMoveFromIndexPath:
    +            (nonnull NSIndexPath *)sourceIndexPath
    +                                      toIndexPath:(nonnull NSIndexPath *)
    +                                                      destinationIndexPath;
    @@ -820,8 +902,8 @@

    Parameters

  • diff --git a/docs/Protocols/IGListBindable.html b/docs/Protocols/IGListBindable.html index bab20c98c..ee67cabd4 100644 --- a/docs/Protocols/IGListBindable.html +++ b/docs/Protocols/IGListBindable.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ + diff --git a/docs/Protocols/IGListBindingSectionControllerDataSource.html b/docs/Protocols/IGListBindingSectionControllerDataSource.html index 61141fa39..d3f37215e 100644 --- a/docs/Protocols/IGListBindingSectionControllerDataSource.html +++ b/docs/Protocols/IGListBindingSectionControllerDataSource.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -288,8 +305,9 @@

    Declaration

    Objective-C

    - (nonnull NSArray<id<IGListDiffable>> *)
    -  sectionController:(nonnull IGListBindingSectionController *)sectionController
    -viewModelsForObject:(nonnull id)object;
    + sectionController: + (nonnull IGListBindingSectionController *)sectionController + viewModelsForObject:(nonnull id)object;
    @@ -358,14 +376,10 @@

    Declaration

    Objective-C

    - (nonnull UICollectionViewCell<IGListBindable> *)
    -sectionController:(nonnull IGListBindingSectionController *)sectionController
    - cellForViewModel:(nonnull id)viewModel
    -          atIndex:(NSInteger)index;
    - -
    -
    -

    Swift

    -
    func sectionController(_ sectionController: IGListBindingSectionController, cellForViewModel viewModel: Any, at index: Int) -> Any!
    + sectionController: + (nonnull IGListBindingSectionController *)sectionController + cellForViewModel:(nonnull id)viewModel + atIndex:(NSInteger)index;
    @@ -447,7 +461,7 @@

    Declaration

    Swift

    -
    func sectionController(_ sectionController: IGListBindingSectionController, sizeForViewModel viewModel: Any, at index: Int) -> Any!
    +
    func sectionController(_ sectionController: IGListBindingSectionController, sizeForViewModel viewModel: Any, at index: Int) -> CGSize
    @@ -506,8 +520,8 @@

    Return Value

    diff --git a/docs/Protocols/IGListBindingSectionControllerSelectionDelegate.html b/docs/Protocols/IGListBindingSectionControllerSelectionDelegate.html index b74995430..fca312db9 100644 --- a/docs/Protocols/IGListBindingSectionControllerSelectionDelegate.html +++ b/docs/Protocols/IGListBindingSectionControllerSelectionDelegate.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -359,11 +376,6 @@

    Parameters

    Tells the delegate that a cell at a given index was deselected.

    -
    -

    Note

    -

    Method is @optional until the 4.0.0 release where it will become required.

    - -
    @@ -378,7 +390,7 @@

    Declaration

    Swift

    -
    optional func sectionController(_ sectionController: IGListBindingSectionController, didDeselectItemAt index: Int, viewModel: Any)
    +
    func sectionController(_ sectionController: IGListBindingSectionController, didDeselectItemAt index: Int, viewModel: Any)
    @@ -456,7 +468,7 @@

    Declaration

    Swift

    -
    optional func sectionController(_ sectionController: IGListBindingSectionController, didHighlightItemAt index: Int, viewModel: Any)
    +
    func sectionController(_ sectionController: IGListBindingSectionController, didHighlightItemAt index: Int, viewModel: Any)
    @@ -534,7 +546,7 @@

    Declaration

    Swift

    -
    optional func sectionController(_ sectionController: IGListBindingSectionController, didUnhighlightItemAt index: Int, viewModel: Any)
    +
    func sectionController(_ sectionController: IGListBindingSectionController, didUnhighlightItemAt index: Int, viewModel: Any)
    @@ -589,8 +601,8 @@

    Parameters

    diff --git a/docs/Protocols/IGListCollectionContext.html b/docs/Protocols/IGListCollectionContext.html index 84a9acc56..4f3268d88 100644 --- a/docs/Protocols/IGListCollectionContext.html +++ b/docs/Protocols/IGListCollectionContext.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -396,6 +413,70 @@

    Declaration

    +
  • +
    + + + + scrollingTraits + +
    +
    +
    +
    +
    +
    +

    The current scrolling traits of the underlying collection view.

    + +
    +
    +

    Declaration

    +
    +

    Objective-C

    +
    @property (readonly, nonatomic) IGListCollectionScrollingTraits scrollingTraits;
    + +
    +
    +

    Swift

    +
    var scrollingTraits: IGListCollectionScrollingTraits { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + experiments + +
    +
    +
    +
    +
    +
    +

    A bitmask of experiments to conduct on the section controller.

    + +
    +
    +

    Declaration

    +
    +

    Objective-C

    +
    @property (assign, readwrite, nonatomic) IGListExperiment experiments;
    + +
    +
    +

    Swift

    +
    var experiments: IGListExperiment { get set }
    + +
    +
    +
    +
    +
  • @@ -546,8 +627,8 @@

    Declaration

    Objective-C

    - (nullable __kindof UICollectionViewCell *)
    -cellForItemAtIndex:(NSInteger)index
    - sectionController:(nonnull IGListSectionController *)sectionController;
    + cellForItemAtIndex:(NSInteger)index + sectionController:(nonnull IGListSectionController *)sectionController;
    @@ -811,7 +892,7 @@

    Declaration

    Swift

    -
    func selectItem(at index: Int, sectionController: IGListSectionController, animated: Bool, scrollPosition: UICollectionViewScrollPosition)
    +
    func selectItem(at index: Int, sectionController: IGListSectionController, animated: Bool, scrollPosition: UICollectionView.ScrollPosition)
    @@ -899,10 +980,11 @@

    Declaration

    Objective-C

    - (nonnull __kindof UICollectionViewCell *)
    -dequeueReusableCellOfClass:(nonnull Class)cellClass
    -       withReuseIdentifier:(nullable NSString *)reuseIdentifier
    -      forSectionController:(nonnull IGListSectionController *)sectionController
    -                   atIndex:(NSInteger)index;
    + dequeueReusableCellOfClass:(nonnull Class)cellClass + withReuseIdentifier:(nullable NSString *)reuseIdentifier + forSectionController: + (nonnull IGListSectionController *)sectionController + atIndex:(NSInteger)index;
    @@ -999,9 +1081,10 @@

    Declaration

    Objective-C

    - (nonnull __kindof UICollectionViewCell *)
    -dequeueReusableCellOfClass:(nonnull Class)cellClass
    -      forSectionController:(nonnull IGListSectionController *)sectionController
    -                   atIndex:(NSInteger)index;
    + dequeueReusableCellOfClass:(nonnull Class)cellClass + forSectionController: + (nonnull IGListSectionController *)sectionController + atIndex:(NSInteger)index;
    @@ -1086,11 +1169,11 @@

    Declaration

    Objective-C

    - (nonnull __kindof UICollectionViewCell *)
    -dequeueReusableCellWithNibName:(nonnull NSString *)nibName
    -                        bundle:(nullable NSBundle *)bundle
    -          forSectionController:
    -              (nonnull IGListSectionController *)sectionController
    -                       atIndex:(NSInteger)index;
    + dequeueReusableCellWithNibName:(nonnull NSString *)nibName + bundle:(nullable NSBundle *)bundle + forSectionController: + (nonnull IGListSectionController *)sectionController + atIndex:(NSInteger)index;
    @@ -1182,11 +1265,12 @@

    Declaration

    Objective-C

    - (nonnull __kindof UICollectionViewCell *)
    -dequeueReusableCellFromStoryboardWithIdentifier:(nonnull NSString *)identifier
    -                           forSectionController:
    -                               (nonnull IGListSectionController *)
    -                                   sectionController
    -                                        atIndex:(NSInteger)index;
    + dequeueReusableCellFromStoryboardWithIdentifier: + (nonnull NSString *)identifier + forSectionController: + (nonnull IGListSectionController *) + sectionController + atIndex:(NSInteger)index;
    @@ -1271,11 +1355,11 @@

    Declaration

    Objective-C

    - (nonnull __kindof UICollectionReusableView *)
    -dequeueReusableSupplementaryViewOfKind:(nonnull NSString *)elementKind
    -                  forSectionController:
    -                      (nonnull IGListSectionController *)sectionController
    -                                 class:(nonnull Class)viewClass
    -                               atIndex:(NSInteger)index;
    + dequeueReusableSupplementaryViewOfKind:(nonnull NSString *)elementKind + forSectionController: + (nonnull IGListSectionController *)sectionController + class:(nonnull Class)viewClass + atIndex:(NSInteger)index;
    @@ -1367,14 +1451,14 @@

    Declaration

    Objective-C

    - (nonnull __kindof UICollectionReusableView *)
    -dequeueReusableSupplementaryViewFromStoryboardOfKind:
    -    (nonnull NSString *)elementKind
    -                                      withIdentifier:
    -                                          (nonnull NSString *)identifier
    -                                forSectionController:
    -                                    (nonnull IGListSectionController *)
    -                                        sectionController
    -                                             atIndex:(NSInteger)index;
    + dequeueReusableSupplementaryViewFromStoryboardOfKind: + (nonnull NSString *)elementKind + withIdentifier: + (nonnull NSString *)identifier + forSectionController: + (nonnull IGListSectionController *) + sectionController + atIndex:(NSInteger)index;
    @@ -1471,12 +1555,12 @@

    Declaration

    Objective-C

    - (nonnull __kindof UICollectionReusableView *)
    -dequeueReusableSupplementaryViewOfKind:(nonnull NSString *)elementKind
    -                  forSectionController:
    -                      (nonnull IGListSectionController *)sectionController
    -                               nibName:(nonnull NSString *)nibName
    -                                bundle:(nullable NSBundle *)bundle
    -                               atIndex:(NSInteger)index;
    + dequeueReusableSupplementaryViewOfKind:(nonnull NSString *)elementKind + forSectionController: + (nonnull IGListSectionController *)sectionController + nibName:(nonnull NSString *)nibName + bundle:(nullable NSBundle *)bundle + atIndex:(NSInteger)index;
    @@ -1656,8 +1740,8 @@

    Parameters

    For example, inside your section controllers, you may want to delete and insert into the data source that backs your section controller. For example:

    [self.collectionContext performBatchItemUpdates:^ (id<IGListBatchContext> batchContext>){
    -  // perform data source changes inside the update block
    -  [self.items addObject:newItem];
    +  // perform data source changes inside the update block
    +  [self.items addObject:newItem];
       [self.items removeObjectAtIndex:0];
     
       NSIndexSet *inserts = [NSIndexSet indexSetWithIndex:[self.items count] - 1];
    @@ -1679,10 +1763,10 @@ 

    Parameters

    Declaration

    Objective-C

    -
    - (void)
    -performBatchAnimated:(BOOL)animated
    -             updates:(nonnull void (^)(id<IGListBatchContext> _Nonnull))updates
    -          completion:(nullable void (^)(BOOL))completion;
    +
    - (void)performBatchAnimated:(BOOL)animated
    +                     updates:(nonnull void (^)(id<IGListBatchContext> _Nonnull))
    +                                 updates
    +                  completion:(nullable void (^)(BOOL))completion;
    @@ -1766,7 +1850,7 @@

    Declaration

    Swift

    -
    func scroll(to sectionController: IGListSectionController, at index: Int, scrollPosition: UICollectionViewScrollPosition, animated: Bool)
    +
    func scroll(to sectionController: IGListSectionController, at index: Int, scrollPosition: UICollectionView.ScrollPosition, animated: Bool)
    @@ -1833,8 +1917,8 @@

    Parameters

  • diff --git a/docs/Protocols/IGListCollectionViewDelegateLayout.html b/docs/Protocols/IGListCollectionViewDelegateLayout.html index c5113e674..f083db075 100644 --- a/docs/Protocols/IGListCollectionViewDelegateLayout.html +++ b/docs/Protocols/IGListCollectionViewDelegateLayout.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -288,11 +305,13 @@

    IGListCollectionViewDelegateLayout

    Declaration

    Objective-C

    -
    - (UICollectionViewLayoutAttributes *)
    -                   collectionView:(UICollectionView *)collectionView
    -                           layout:(UICollectionViewLayout *)collectionViewLayout
    -customizedInitialLayoutAttributes:(UICollectionViewLayoutAttributes *)attributes
    -                      atIndexPath:(NSIndexPath *)indexPath;
    +
    - (UICollectionViewLayoutAttributes *)collectionView:
    +                                          (UICollectionView *)collectionView
    +                                              layout:(UICollectionViewLayout *)
    +                                                         collectionViewLayout
    +                   customizedInitialLayoutAttributes:
    +                       (UICollectionViewLayoutAttributes *)attributes
    +                                         atIndexPath:(NSIndexPath *)indexPath;
    @@ -380,10 +399,12 @@

    Declaration

    Objective-C

    - (UICollectionViewLayoutAttributes *)
    -                 collectionView:(UICollectionView *)collectionView
    -                         layout:(UICollectionViewLayout *)collectionViewLayout
    -customizedFinalLayoutAttributes:(UICollectionViewLayoutAttributes *)attributes
    -                    atIndexPath:(NSIndexPath *)indexPath;
    + collectionView:(UICollectionView *)collectionView + layout: + (UICollectionViewLayout *)collectionViewLayout + customizedFinalLayoutAttributes: + (UICollectionViewLayoutAttributes *)attributes + atIndexPath:(NSIndexPath *)indexPath;
    @@ -455,8 +476,8 @@

    Parameters

    diff --git a/docs/Classes/IGListStackedSectionController.html b/docs/Protocols/IGListCollectionViewLayoutCompatible.html similarity index 72% rename from docs/Classes/IGListStackedSectionController.html rename to docs/Protocols/IGListCollectionViewLayoutCompatible.html index 1c8b998c7..8c1c9ac97 100644 --- a/docs/Classes/IGListStackedSectionController.html +++ b/docs/Protocols/IGListCollectionViewLayoutCompatible.html @@ -1,7 +1,7 @@ - IGListStackedSectionController Class Reference + IGListCollectionViewLayoutCompatible Protocol Reference @@ -10,8 +10,8 @@ - - + +

    IGListKit Docs (98% documented)

    @@ -22,7 +22,7 @@
    @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,27 +258,27 @@ +
    -

    IGListStackedSectionController

    +

    IGListCollectionViewLayoutCompatible

    -
    
    -@interface IGListStackedSectionController : IGListSectionController
    +
    @protocol IGListCollectionViewLayoutCompatible <NSObject>
    -

    An instance of IGListStackedSectionController is a clustered section controller, composed of many child section -controllers. It constructs and routes item-level indexes to the appropriate child section controller with a local -index. This lets you build section controllers made up of individual units that can be shared and reused with other -section controllers.

    - -

    For example, you can create a Comments section controller that displays lists of text that is used alongside photo, -video, or slideshow section controllers. You then have four small and manageable section controllers instead of one -huge class.

    +

    A protocol for layouts that defines interaction with an IGListCollectionView, for recieving updated section indexes.

    @@ -278,9 +287,9 @@

    IGListStackedSectionController

  • @@ -288,15 +297,14 @@

    IGListStackedSectionController

    -

    Creates a new stacked section controller.

    +

    Called to notify the layout that a specific section was modified before invalidation. This can be used to optimize +layout re-calculation.

    Note

    -

    The order of the section controllers dictates the order in which they appear.

    - -
    -
    -

    Warning

    -

    The first section controller that is the supplementary source decides which supplementary views get displayed.

    +

    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.

    @@ -305,13 +313,12 @@

    IGListStackedSectionController

    Declaration

    Objective-C

    -
    - (nonnull instancetype)initWithSectionControllers:
    -    (nonnull NSArray<IGListSectionController *> *)sectionControllers;
    +
    - (void)didModifySection:(NSInteger)modifiedSection;

    Swift

    -
    init(sectionControllers: [ListSectionController])
    +
    func didModifySection(_ modifiedSection: Int)
    @@ -322,12 +329,12 @@

    Parameters

    - sectionControllers + modifiedSection
    -

    An array of section controllers that make up the stack.

    +

    The section that was modified.

    @@ -342,8 +349,8 @@

    Parameters

  • diff --git a/docs/Protocols/IGListDiffable.html b/docs/Protocols/IGListDiffable.html index 90d6faa32..c35ea446f 100644 --- a/docs/Protocols/IGListDiffable.html +++ b/docs/Protocols/IGListDiffable.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ + diff --git a/docs/Protocols/IGListDisplayDelegate.html b/docs/Protocols/IGListDisplayDelegate.html index 7eb25246f..d9bd4559b 100644 --- a/docs/Protocols/IGListDisplayDelegate.html +++ b/docs/Protocols/IGListDisplayDelegate.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ + diff --git a/docs/Protocols/IGListScrollDelegate.html b/docs/Protocols/IGListScrollDelegate.html index decb52e0a..47818a830 100644 --- a/docs/Protocols/IGListScrollDelegate.html +++ b/docs/Protocols/IGListScrollDelegate.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -457,6 +474,19 @@

    Parameters

    + + + + decelerate + + + +
    +

    ‘Yes’ if the scrolling movement will continue, but decelerate, after a touch-up gesture during a +dragging operation. If the value is ‘No’, scrolling stops immediately upon touch-up.

    +
    + + @@ -538,8 +568,8 @@

    Parameters

    diff --git a/docs/Protocols/IGListSingleSectionControllerDelegate.html b/docs/Protocols/IGListSingleSectionControllerDelegate.html index dc830ff02..ccb21c1c3 100644 --- a/docs/Protocols/IGListSingleSectionControllerDelegate.html +++ b/docs/Protocols/IGListSingleSectionControllerDelegate.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ + diff --git a/docs/Protocols/IGListSupplementaryViewSource.html b/docs/Protocols/IGListSupplementaryViewSource.html index ce72b0ff1..c204a8159 100644 --- a/docs/Protocols/IGListSupplementaryViewSource.html +++ b/docs/Protocols/IGListSupplementaryViewSource.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -336,8 +353,8 @@

    Declaration

    Objective-C

    - (nonnull __kindof UICollectionReusableView *)
    -viewForSupplementaryElementOfKind:(nonnull NSString *)elementKind
    -                          atIndex:(NSInteger)index;
    + viewForSupplementaryElementOfKind:(nonnull NSString *)elementKind + atIndex:(NSInteger)index;
    @@ -453,8 +470,8 @@

    Return Value

    diff --git a/docs/Protocols/IGListTransitionDelegate.html b/docs/Protocols/IGListTransitionDelegate.html index eed4c4c7d..744a39418 100644 --- a/docs/Protocols/IGListTransitionDelegate.html +++ b/docs/Protocols/IGListTransitionDelegate.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -287,11 +304,12 @@

    IGListTransitionDelegate

    Declaration

    Objective-C

    -
    - (UICollectionViewLayoutAttributes *)
    -                      listAdapter:(IGListAdapter *)listAdapter
    -customizedInitialLayoutAttributes:(UICollectionViewLayoutAttributes *)attributes
    -                sectionController:(IGListSectionController *)sectionController
    -                          atIndex:(NSInteger)index;
    +
    - (UICollectionViewLayoutAttributes *)listAdapter:(IGListAdapter *)listAdapter
    +                customizedInitialLayoutAttributes:
    +                    (UICollectionViewLayoutAttributes *)attributes
    +                                sectionController:
    +                                    (IGListSectionController *)sectionController
    +                                          atIndex:(NSInteger)index;
    @@ -378,11 +396,12 @@

    Parameters

    Declaration

    Objective-C

    -
    - (UICollectionViewLayoutAttributes *)
    -                    listAdapter:(IGListAdapter *)listAdapter
    -customizedFinalLayoutAttributes:(UICollectionViewLayoutAttributes *)attributes
    -              sectionController:(IGListSectionController *)sectionController
    -                        atIndex:(NSInteger)index;
    +
    - (UICollectionViewLayoutAttributes *)listAdapter:(IGListAdapter *)listAdapter
    +                  customizedFinalLayoutAttributes:
    +                      (UICollectionViewLayoutAttributes *)attributes
    +                                sectionController:
    +                                    (IGListSectionController *)sectionController
    +                                          atIndex:(NSInteger)index;
    @@ -454,8 +473,8 @@

    Parameters

    diff --git a/docs/Protocols/IGListUpdatingDelegate.html b/docs/Protocols/IGListUpdatingDelegate.html index 6a2105005..40d750e36 100644 --- a/docs/Protocols/IGListUpdatingDelegate.html +++ b/docs/Protocols/IGListUpdatingDelegate.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ +
    @@ -317,9 +334,9 @@

    Return Value

  • @@ -344,15 +361,19 @@

    Return Value

    Declaration

    Objective-C

    -
    - (void)
    -performUpdateWithCollectionView:(nonnull UICollectionView *)collectionView
    -                    fromObjects:
    -                        (nullable NSArray<id<IGListDiffable>> *)fromObjects
    -                 toObjectsBlock:(nullable IGListToObjectBlock)toObjectsBlock
    -                       animated:(BOOL)animated
    -          objectTransitionBlock:
    -              (nonnull IGListObjectTransitionBlock)objectTransitionBlock
    -                     completion:(nullable IGListUpdatingCompletion)completion;
    +
    - (void)performUpdateWithCollectionViewBlock:
    +            (nonnull IGListCollectionViewBlock)collectionViewBlock
    +                                 fromObjects:
    +                                     (nullable NSArray<id<IGListDiffable>> *)
    +                                         fromObjects
    +                              toObjectsBlock:
    +                                  (nullable IGListToObjectBlock)toObjectsBlock
    +                                    animated:(BOOL)animated
    +                       objectTransitionBlock:
    +                           (nonnull IGListObjectTransitionBlock)
    +                               objectTransitionBlock
    +                                  completion:(nullable IGListUpdatingCompletion)
    +                                                 completion;
    @@ -363,12 +384,12 @@

    Parameters

    - collectionView + collectionViewBlock
    -

    The collection view to perform the transition on.

    +

    A block returning the collecion view to perform updates on.

    @@ -809,9 +830,9 @@

    Parameters

  • @@ -826,15 +847,17 @@

    Parameters

    Declaration

    Objective-C

    -
    - (void)
    -reloadDataWithCollectionView:(nonnull UICollectionView *)collectionView
    -           reloadUpdateBlock:(nonnull IGListReloadUpdateBlock)reloadUpdateBlock
    -                  completion:(nullable IGListUpdatingCompletion)completion;
    +
    - (void)reloadDataWithCollectionViewBlock:
    +            (nonnull IGListCollectionViewBlock)collectionViewBlock
    +                        reloadUpdateBlock:
    +                            (nonnull IGListReloadUpdateBlock)reloadUpdateBlock
    +                               completion:(nullable IGListUpdatingCompletion)
    +                                              completion;

    Swift

    -
    func reloadData(with collectionView: UICollectionView, reloadUpdate reloadUpdateBlock: @escaping ListReloadUpdateBlock, completion: ListUpdatingCompletion? = nil)
    +
    func reloadData(collectionViewBlock: @escaping ListCollectionViewBlock, reloadUpdate reloadUpdateBlock: @escaping ListReloadUpdateBlock, completion: ListUpdatingCompletion? = nil)
    @@ -845,12 +868,12 @@

    Parameters

    - collectionView + collectionViewBlock
    -

    The collection view to reload.

    +

    A block returning the collecion view to reload.

    @@ -951,9 +974,9 @@

    Parameters

  • @@ -968,16 +991,18 @@

    Parameters

    Declaration

    Objective-C

    -
    - (void)
    -performUpdateWithCollectionView:(nonnull UICollectionView *)collectionView
    -                       animated:(BOOL)animated
    -                    itemUpdates:(nonnull IGListItemUpdateBlock)itemUpdates
    -                     completion:(nullable IGListUpdatingCompletion)completion;
    +
    - (void)performUpdateWithCollectionViewBlock:
    +            (nonnull IGListCollectionViewBlock)collectionViewBlock
    +                                    animated:(BOOL)animated
    +                                 itemUpdates:
    +                                     (nonnull IGListItemUpdateBlock)itemUpdates
    +                                  completion:(nullable IGListUpdatingCompletion)
    +                                                 completion;

    Swift

    -
    func performUpdate(with collectionView: UICollectionView, animated: Bool, itemUpdates: @escaping ListItemUpdateBlock, completion: ListUpdatingCompletion? = nil)
    +
    func performUpdate(collectionViewBlock: @escaping ListCollectionViewBlock, animated: Bool, itemUpdates: @escaping ListItemUpdateBlock, completion: ListUpdatingCompletion? = nil)
    @@ -988,12 +1013,12 @@

    Parameters

    - collectionView + collectionViewBlock
    -

    The collection view to update.

    +

    A block returning the collecion view to perform updates on.

    @@ -1044,8 +1069,8 @@

    Parameters

  • diff --git a/docs/Protocols/IGListWorkingRangeDelegate.html b/docs/Protocols/IGListWorkingRangeDelegate.html index aed33595d..23b62e3e9 100644 --- a/docs/Protocols/IGListWorkingRangeDelegate.html +++ b/docs/Protocols/IGListWorkingRangeDelegate.html @@ -35,7 +35,7 @@ Best Practices and FAQ - + @@ -174,6 +174,9 @@ + @@ -201,31 +204,37 @@ @@ -249,6 +258,14 @@ + diff --git a/docs/generating-your-models.html b/docs/Structs.html similarity index 57% rename from docs/generating-your-models.html rename to docs/Structs.html index 9cb917e0c..1c25d7711 100644 --- a/docs/generating-your-models.html +++ b/docs/Structs.html @@ -1,7 +1,7 @@ - Generating your models Reference + Structures Reference @@ -10,7 +10,8 @@ - + +

    IGListKit Docs (98% documented)

    @@ -21,7 +22,7 @@
    @@ -34,7 +35,7 @@ Best Practices and FAQ - + @@ -173,6 +174,9 @@ + @@ -200,31 +204,37 @@ @@ -248,178 +258,67 @@ +
    - -

    Generating your IGListDiffable models

    - -

    With the IGListDiffable plugin for remodel by facebook, you can automatically generate models conforming to the IGListDiffable.

    - -

    This will automatically implement hash, isEqual: and description, as well as diffIdentifier and isEqualToDiffableObject: for you. Remodel is also capable to generate additional code, like conforming to NSCoding or additional Builder classes for your model object. It will make creating and updating models much easier, faster and safer.

    - -

    In /remodel-plugin, you can find the source files to build the IGListDiffable plugin locally.

    -

    Installation

    -

    1. Remodel installation

    - -

    Please follow the installation instructions in the main remodel repository.

    - -

    tl;dr: Either clone the original repository, or use an npm installation. In the latter case you can run which remodel-gen to find out the path of your installation.

    -

    2. Plugin installation

    - -

    Copy the following files & folders within /remodel-plugin into your local remodel checkout:

    - -
      -
    • /src/plugins/iglistdiffable.ts - the actual plugin
    • -
    • /src/__tests__/plugins/iglistdiffable-test.ts - unit tests
    • -
    • /features/iglistdiffable.feature - integration tests
    • -
    - -

    And then register the new plugin with the system:

    - -
      -
    • Edit /remodel/src/value-object-default-config.ts and add iglistdiffable to the list of basePlugins:
    • -
    -
    // value-object-default-config.ts
    -basePlugins: List.of(
    -    'assert-nullability',
    -    'assume-nonnull',
    -    'builder',
    -    'coding',
    -    'copying',
    -    'description',
    -    'equality',
    -    'fetch-status',
    -    'immutable-properties',
    -    'init-new-unavailable',
    -    'use-cpp',
    -    'iglistdiffable'
    -  )
    -
    -

    3. Build plugin:

    - -

    Once you copied them over and registered the plugin, you have to compile the typescript files into javascript. Do do so run this command from the remodel directory:

    - -
      -
    • ./bin/build
    • -
    -

    4. Run tests (optional)

    - -

    To run the unit/integration tests, you can run the following commands:

    - -
      -
    • ./bin/runUnitTests
    • -
    • ./bin/runAcceptanceTests
    • -
    - -

    This is especially useful if you plan to change/extend the plugin in any way.

    -

    5. Use the plugin

    - -

    Now you are ready to generate your IGListDiffable conforming models! To generate a model, create a new .value file. Here’s an example:

    -
    // PersonModel.value
    -PersonModel includes(IGListDiffable) {
    -  NSString *firstName
    -  NSString *lastName
    -  %diffIdentifier
    -  NSString *uniqueId
    -}
    -
    - -

    To generate your Objective-C models, run the generation tool like this:

    - -

    ./bin/generate path/to/your/PersonModel.value

    - -

    This will generate the following Objective-C files in the same directory:

    -
    // PersonModel.h
    -@interface PersonModel : NSObject <IGListDiffable, NSCopying>
    -
    -@property (nonatomic, readonly, copy) NSString *firstName;
    -@property (nonatomic, readonly, copy) NSString *lastName;
    -@property (nonatomic, readonly, copy) NSString *uniqueId;
    -
    -- (instancetype)initWithFirstName:(NSString *)firstName lastName:(NSString *)lastName uniqueId:(NSString *)uniqueId;
    -
    -@end
    -
    - -

    and

    -
    // PersonModel.m
    -@implementation PersonModel
    -
    -- (instancetype)initWithFirstName:(NSString *)firstName lastName:(NSString *)lastName uniqueId:(NSString *)uniqueId
    -{
    -  if ((self = [super init])) {
    -    _firstName = [firstName copy];
    -    _lastName = [lastName copy];
    -    _uniqueId = [uniqueId copy];
    -  }
    -
    -  return self;
    -}
    -
    -- (id<NSObject>)diffIdentifier
    -{
    -  return _uniqueId;
    -}
    -
    -- (BOOL)isEqualToDiffableObject:(nullable id)object
    -{
    -  return [self isEqual:object];
    -}
    -
    -- (BOOL)isEqual:(PersonModel *)object
    -{
    -  if (self == object) {
    -    return YES;
    -  } else if (self == nil || object == nil || ![object isKindOfClass:[self class]]) {
    -    return NO;
    -  }
    -  return
    -    (_firstName == object->_firstName ? YES : [_firstName isEqual:object->_firstName]) &&
    -    (_lastName == object->_lastName ? YES : [_lastName isEqual:object->_lastName]) &&
    -    (_uniqueId == object->_uniqueId ? YES : [_uniqueId isEqual:object->_uniqueId]);
    -}
    -
    -- (id)copyWithZone:(nullable NSZone *)zone
    -{
    -  return self;
    -}
    -
    -- (NSString *)description
    -{
    -  return [NSString stringWithFormat:@"%@ - \n\t firstName: %@; \n\t lastName: %@; \n\t uniqueId: %@; \n", [super description], _firstName, _lastName, _uniqueId];
    -}
    -
    -- (NSUInteger)hash
    -{
    -  NSUInteger subhashes[] = {[_firstName hash], [_lastName hash], [_uniqueId hash]};
    -  NSUInteger result = subhashes[0];
    -  for (int ii = 1; ii < 3; ++ii) {
    -    unsigned long long base = (((unsigned long long)result) << 32 | subhashes[ii]);
    -    base = (~base) + (base << 18);
    -    base ^= (base >> 31);
    -    base *=  21;
    -    base ^= (base >> 11);
    -    base += (base << 6);
    -    base ^= (base >> 22);
    -    result = base;
    -  }
    -  return result;
    -}
    -
    -@end
    -
    -

    Documentation

    - -

    Please see the main remodel repository for additional documentation

    +

    Structures

    +

    The following structures are available globally.

    +
    +
    +
      +
    • + +
      +
      +
      +
      +
      +

      The current scrolling traits of the underlying collection view. +The attributes are always equal to their corresponding properties on the underlying collection view.

      + + See more +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      struct IGListCollectionScrollingTraits {}
      + +
      +
      +

      Swift

      +
      struct IGListCollectionScrollingTraits
      + +
      +
      +
      +
      +
    • +
    +
    +
    diff --git a/docs/Structs/IGListCollectionScrollingTraits.html b/docs/Structs/IGListCollectionScrollingTraits.html new file mode 100644 index 000000000..4edab6bbf --- /dev/null +++ b/docs/Structs/IGListCollectionScrollingTraits.html @@ -0,0 +1,396 @@ + + + + IGListCollectionScrollingTraits Structure Reference + + + + + + + + + + +
    +
    +

    IGListKit Docs (98% documented)

    +

    View on GitHub

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    IGListCollectionScrollingTraits

    +
    +
    +
    struct IGListCollectionScrollingTraits {}
    + +
    +
    +

    The current scrolling traits of the underlying collection view. +The attributes are always equal to their corresponding properties on the underlying collection view.

    + +
    +
    +
    +
      +
    • +
      + + + + isTracking + +
      +
      +
      +
      +
      +
      +

      returns YES if user has touched. may not yet have started dragging.

      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      _Bool isTracking
      + +
      +
      +

      Swift

      +
      var isTracking: Bool
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + isDragging + +
      +
      +
      +
      +
      +
      +

      returns YES if user has started scrolling. this may require some time and or distance to move to initiate dragging

      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      _Bool isDragging
      + +
      +
      +

      Swift

      +
      var isDragging: Bool
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + isDecelerating + +
      +
      +
      +
      +
      +
      +

      returns YES if user isn’t dragging (touch up) but scroll view is still moving.

      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      _Bool isDecelerating
      + +
      +
      +

      Swift

      +
      var isDecelerating: Bool
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Type Definitions.html b/docs/Type Definitions.html index addd41394..164cfad99 100644 --- a/docs/Type Definitions.html +++ b/docs/Type Definitions.html @@ -10,6 +10,7 @@ +
    +
    + +
    • @@ -649,13 +699,45 @@

      Declaration

    +
  • + +
    +
    +
    +
    +
    +

    A block that returns a collection view to perform updates on.

    + +
    +
    +

    Declaration

    +
    +

    Objective-C

    +
    typedef UICollectionView *_Nullable (^IGListCollectionViewBlock)(void)
    + +
    +
    +

    Swift

    +
    typealias ListCollectionViewBlock = () -> UICollectionView?
    + +
    +
    +
    +
    +
  • diff --git a/docs/Type Definitions/IGListCollectionScrollingTraits.html b/docs/Type Definitions/IGListCollectionScrollingTraits.html new file mode 100644 index 000000000..b5d43a396 --- /dev/null +++ b/docs/Type Definitions/IGListCollectionScrollingTraits.html @@ -0,0 +1,333 @@ + + + + IGListCollectionScrollingTraits Type Definition Reference + + + + + + + + + + +
    +
    +

    IGListKit Docs (98% documented)

    +

    View on GitHub

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    IGListCollectionScrollingTraits

    + +

    Undocumented

    + +
    +
    +
    +
      +
    • + +
      +
      +
      +
      +
      +

      The current scrolling traits of the underlying collection view. +The attributes are always equal to their corresponding properties on the underlying collection view.

      + + See more +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      struct IGListCollectionScrollingTraits {}
      + +
      +
      +

      Swift

      +
      struct IGListCollectionScrollingTraits
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Type Definitions/IGListCollectionScrollingTraits/IGListCollectionScrollingTraits.html b/docs/Type Definitions/IGListCollectionScrollingTraits/IGListCollectionScrollingTraits.html new file mode 100644 index 000000000..73eac391d --- /dev/null +++ b/docs/Type Definitions/IGListCollectionScrollingTraits/IGListCollectionScrollingTraits.html @@ -0,0 +1,396 @@ + + + + IGListCollectionScrollingTraits Structure Reference + + + + + + + + + + +
    +
    +

    IGListKit Docs (98% documented)

    +

    View on GitHub

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    IGListCollectionScrollingTraits

    +
    +
    +
    struct IGListCollectionScrollingTraits {}
    + +
    +
    +

    The current scrolling traits of the underlying collection view. +The attributes are always equal to their corresponding properties on the underlying collection view.

    + +
    +
    +
    +
      +
    • +
      + + + + isTracking + +
      +
      +
      +
      +
      +
      +

      returns YES if user has touched. may not yet have started dragging.

      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      _Bool isTracking
      + +
      +
      +

      Swift

      +
      var isTracking: Bool
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + isDragging + +
      +
      +
      +
      +
      +
      +

      returns YES if user has started scrolling. this may require some time and or distance to move to initiate dragging

      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      _Bool isDragging
      + +
      +
      +

      Swift

      +
      var isDragging: Bool
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + isDecelerating + +
      +
      +
      +
      +
      +
      +

      returns YES if user isn’t dragging (touch up) but scroll view is still moving.

      + +
      +
      +

      Declaration

      +
      +

      Objective-C

      +
      _Bool isDecelerating
      + +
      +
      +

      Swift

      +
      var isDecelerating: Bool
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/best-practices-and-faq.html b/docs/best-practices-and-faq.html index 7b46727d6..c5414c503 100644 --- a/docs/best-practices-and-faq.html +++ b/docs/best-practices-and-faq.html @@ -34,7 +34,7 @@ Best Practices and FAQ - + @@ -173,6 +173,9 @@ + @@ -200,31 +203,37 @@ @@ -248,6 +257,14 @@ +
    @@ -301,7 +318,7 @@

    Does IGListKit
  • Core Data (Working with Core Data Guide)
  • AsyncDisplayKit (AsyncDisplayKit/#2942)
  • ComponentKit (ocrickard/IGListKit-ComponentKit)
  • -
  • RxSwift (yuzushioh/RxIGListKit)
  • +
  • RxSwift (RxSwiftCommunity/RxIGListKit)
  • React Native
  • Reactive Cocoa
  • @@ -318,7 +335,7 @@

    How can

    See discussion at #184.

    I have a huge data set and -performUpdatesAnimated: completion: is super slow. What do I do?

    -

    If you have multiple thousands of items and you cannot batch them in, you’ll see performance issues with -performUpdatesAnimated: completion:. The real bottle neck behind the scenes here is UICollectionView attempting to insert so many cells at once. Instead, call -reloadDataWithCompletion: when you first load data. Behind the scenes, this method does not do any diffing and simply calls -reloadData on UICollectionView. For subsequent updates, you can then use -performUpdatesAnimated: completion:.

    +

    If you have multiple thousands of items and you cannot batch them in, you’ll see performance issues with -performUpdatesAnimated: completion:. The real bottleneck behind the scenes here is UICollectionView attempting to insert so many cells at once. Instead, call -reloadDataWithCompletion: when you first load data. Behind the scenes, this method does not do any diffing and simply calls -reloadData on UICollectionView. For subsequent updates, you can then use -performUpdatesAnimated: completion:.

    How do I use IGListKit and estimated cell sizes with Auto Layout?

    This should work in theory, and we have an example section controller, but the estimated-size API in UICollectionViewFlowLayout has changed dramatically over different iOS versions, making first-class support in IGListKit difficult. We don’t use estimated cell sizes or Auto Layout in Instagram and cannot commit to fully supporting it.

    @@ -389,8 +406,8 @@