IGListGenericSectionController

Objective-C


@interface IGListGenericSectionController<__covariant ObjectType>
    : IGListSectionController

Swift

class ListGenericSectionController<ObjectType> : ListSectionController where ObjectType : AnyObject

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

  • The object mapped to this section controller. Matches the object provided in [IGListAdapterDataSource listAdapter:sectionControllerForObject:] when this section controller was created and returned.

    Note

    This object is briefly nil between initialization and the first call to didUpdateToObject:. After that, it is safe to assume that this is non-nil. For this reason, we bridge it to Swift as an implicitly-unwrapped Optional, so that idiomatic IGListKit code is not forced to handle nullability with explicit as! or fatalError.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, null_unspecified) ObjectType object;

    Swift

    var object: ObjectType! { get }
  • Updates the section controller to a new object.

    Note

    This IGListSectionController subclass sets its object in this method, so any overrides must call super.

    Declaration

    Objective-C

    - (void)didUpdateToObject:(nonnull ObjectType)object;

    Swift

    func didUpdate(to object: ObjectType)

    Parameters

    object

    The object mapped to this section controller.