IGListSingleSectionController
@interface IGListSingleSectionController
: IGListSectionController <IGListSectionType>
This section controller is meant to make building simple, single-cell feeds easier. By providing the type of cell, a block to configure the cell, and a block to return the size of a cell, you can use an IGListAdapter-powered feed without overcomplicating your architecture.
-
Create a new section controller for a given cell type that will always have only one cell when present in a feed.
Warning
Be VERY CAREFUL not to create retain cycles by holding strong references to: the object that owns the adapter (usually
self
) or the IGListAdapter. Pass in locally scoped objects or use weak references!Declaration
Objective-C
- (nonnull instancetype) initWithCellClass:(nonnull Class)cellClass configureBlock: (nonnull void (^)(id _Nonnull, __kindof UICollectionViewCell *_Nonnull))configureBlock sizeBlock: (nonnull CGSize (^)(id<IGListCollectionContext> _Nonnull))sizeBlock;Swift
init!(cellClass: AnyClass!, configureBlock: (@escaping (Any?, UnsafeMutablePointerParameters
cellClassThe UICollectionViewCell subclass for the single cell.
configureBlockA block that configures the cell with the item given to the section controller.
sizeBlockA block that returns the size for the cell given the collection context.
Return Value
A new section controller.
-
An optional delegate that handles selection and deselection.
Declaration
Objective-C
@property (readwrite, nonatomic, nullable) id<IGListSingleSectionControllerDelegate> selectionDelegate;Swift
weak var selectionDelegate: IGListSingleSectionControllerDelegate? { get set } -
Undocumented
Declaration
Objective-C
@interface IGListSingleSectionController : IGListSectionController <IGListSectionType> -
Undocumented
Declaration
Objective-C
@interface IGListSingleSectionController : IGListSectionController <IGListSectionType>
View on GitHub
IGListSingleSectionController Class Reference