# IGListGenericSectionController Class Reference

# 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:`.

- `object`

  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 }

- `-didUpdateToObject:`

  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.

© 2024 Instagram. All rights reserved. (Last updated: 2024-05-13)

Generated by jazzy ♪♫ v0.15.0, a Realm project.