IGListSingleSectionController
Objective-C
@interface IGListSingleSectionController : IGListSectionController
                Swift
class ListSingleSectionController : ListSectionController
                This section controller is meant to make building simple, single-cell lists 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 list with a
simpler architecture.
- 
                  
                  
Creates a new section controller for a given cell type that will always have only one cell when present in a list.
Warning
Be VERY CAREFUL not to create retain cycles by holding strong references to: the object that owns the adapter (usually
self) or theIGListAdapter. Pass in locally scoped objects or useweakreferences!Declaration
Objective-C
- (nonnull instancetype) initWithCellClass:(nonnull Class)cellClass configureBlock: (nonnull IGListSingleSectionCellConfigureBlock)configureBlock sizeBlock:(nonnull IGListSingleSectionCellSizeBlock)sizeBlock;Swift
init(cellClass: AnyClass, configureBlock: @escaping ListSingleSectionCellConfigureBlock, sizeBlock: @escaping ListSingleSectionCellSizeBlock)Parameters
cellClassThe
UICollectionViewCellsubclass 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.
 - 
                  
                  
Creates a new section controller for a given nib name and bundle that will always have only one cell when present in a list.
Warning
Be VERY CAREFUL not to create retain cycles by holding strong references to: the object that owns the adapter (usually
self) or theIGListAdapter. Pass in locally scoped objects or useweakreferences!Declaration
Objective-C
- (nonnull instancetype) initWithNibName:(nonnull NSString *)nibName bundle:(nullable NSBundle *)bundle configureBlock: (nonnull IGListSingleSectionCellConfigureBlock)configureBlock sizeBlock:(nonnull IGListSingleSectionCellSizeBlock)sizeBlock;Swift
init(nibName: String, bundle: Bundle?, configureBlock: @escaping ListSingleSectionCellConfigureBlock, sizeBlock: @escaping ListSingleSectionCellSizeBlock)Parameters
nibNameThe name of the nib file for the single cell.
bundleThe bundle in which to search for the nib file. If
nil, this method looks for the file in the main bundle.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.
 - 
                  
                  
Creates a new section controller for a given storyboard cell identifier that will always have only one cell when present in a list.
Warning
Be VERY CAREFUL not to create retain cycles by holding strong references to: the object that owns the adapter (usually
self) or theIGListAdapter. Pass in locally scoped objects or useweakreferences!Declaration
Objective-C
- (nonnull instancetype) initWithStoryboardCellIdentifier:(nonnull NSString *)identifier configureBlock: (nonnull IGListSingleSectionCellConfigureBlock) configureBlock sizeBlock:(nonnull IGListSingleSectionCellSizeBlock) sizeBlock;Swift
init(storyboardCellIdentifier identifier: String, configureBlock: @escaping ListSingleSectionCellConfigureBlock, sizeBlock: @escaping ListSingleSectionCellSizeBlock)Parameters
identifierThe identifier of the cell prototype in storyboard.
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 (nonatomic, weak, nullable) id<IGListSingleSectionControllerDelegate> selectionDelegate;Swift
weak var selectionDelegate: (any ListSingleSectionControllerDelegate)? { get set } 
View on GitHub