2016-09-07 22:37:59 +00:00
<!DOCTYPE html>
< html lang = "en" >
< head >
< title > IGListSingleSectionController Class Reference< / title >
< link rel = "stylesheet" type = "text/css" href = "../css/jazzy.css" / >
< link rel = "stylesheet" type = "text/css" href = "../css/highlight.css" / >
< meta charset = 'utf-8' >
< script src = "../js/jquery.min.js" defer > < / script >
< script src = "../js/jazzy.js" defer > < / script >
< / head >
< body >
< a name = "//apple_ref/objc/Class/IGListSingleSectionController" class = "dashAnchor" > < / a >
< a title = "IGListSingleSectionController Class Reference" > < / a >
< header >
< div class = "content-wrapper" >
2017-08-23 21:12:05 +00:00
< p > < a href = "../index.html" > IGListKit Docs< / a > (98% documented)< / p >
2016-09-07 22:37:59 +00:00
< p class = "header-right" > < a href = "https://github.com/Instagram/IGListKit" > < img src = "../img/gh.png" / > View on GitHub< / a > < / p >
< / div >
< / header >
< div class = "content-wrapper" >
< p id = "breadcrumbs" >
< a href = "../index.html" > IGListKit Reference< / a >
< img id = "carat" src = "../img/carat.png" / >
IGListSingleSectionController Class Reference
< / p >
< / div >
< div class = "content-wrapper" >
< nav class = "sidebar" >
< ul class = "nav-groups" >
2016-11-23 20:42:52 +00:00
< li class = "nav-group-name" >
< a href = "../Guides.html" > Guides< / a >
< ul class = "nav-group-tasks" >
2017-05-12 14:19:12 +00:00
< li class = "nav-group-task" >
< a href = "../best-practices-and-faq.html" > Best Practices and FAQ< / a >
< / li >
2018-04-23 16:27:43 +00:00
< li class = "nav-group-task" >
< a href = "../generating-your-models.html" > Generating your models< / a >
< / li >
2016-11-23 20:42:52 +00:00
< li class = "nav-group-task" >
< a href = "../getting-started.html" > Getting Started< / a >
< / li >
2016-11-28 00:53:20 +00:00
< li class = "nav-group-task" >
< a href = "../iglistdiffable-and-equality.html" > IGListDiffable and Equality< / a >
< / li >
2016-12-27 20:37:57 +00:00
< li class = "nav-group-task" >
< a href = "../installation.html" > Installation< / a >
< / li >
2016-11-23 20:42:52 +00:00
< li class = "nav-group-task" >
< a href = "../migration.html" > Migration< / a >
< / li >
2017-08-23 21:12:05 +00:00
< li class = "nav-group-task" >
< a href = "../modeling-and-binding.html" > Modeling and Binding< / a >
< / li >
2017-05-12 14:19:12 +00:00
< li class = "nav-group-task" >
< a href = "../vision.html" > VISION< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../working-with-core-data.html" > Working with Core Data< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../working-with-uicollectionview.html" > Working with UICollectionView< / a >
< / li >
2016-11-23 20:42:52 +00:00
< / ul >
< / li >
2016-09-07 22:37:59 +00:00
< li class = "nav-group-name" >
< a href = "../Classes.html" > Classes< / a >
< ul class = "nav-group-tasks" >
< li class = "nav-group-task" >
< a href = "../Classes/IGListAdapter.html" > IGListAdapter< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Classes/IGListAdapterUpdater.html" > IGListAdapterUpdater< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Classes/IGListBatchUpdateData.html" > IGListBatchUpdateData< / a >
< / li >
< li class = "nav-group-task" >
2017-05-12 14:19:12 +00:00
< a href = "../Classes/IGListBindingSectionController.html" > IGListBindingSectionController< / a >
< / li >
2018-02-06 23:42:25 +00:00
< li class = "nav-group-task" >
< a href = "../Classes/IGListCollectionView.html" > IGListCollectionView< / a >
< / li >
2017-05-12 14:19:12 +00:00
< li class = "nav-group-task" >
< a href = "../Classes/IGListCollectionViewLayout.html" > IGListCollectionViewLayout< / a >
2016-09-07 22:37:59 +00:00
< / li >
2016-11-22 07:18:30 +00:00
< li class = "nav-group-task" >
2017-05-12 14:19:12 +00:00
< a href = "../Classes/IGListGenericSectionController.html" > IGListGenericSectionController< / a >
2016-11-22 07:18:30 +00:00
< / li >
2016-09-07 22:37:59 +00:00
< li class = "nav-group-task" >
< a href = "../Classes/IGListIndexPathResult.html" > IGListIndexPathResult< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Classes/IGListIndexSetResult.html" > IGListIndexSetResult< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Classes/IGListMoveIndex.html" > IGListMoveIndex< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Classes/IGListMoveIndexPath.html" > IGListMoveIndexPath< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Classes.html#/c:objc(cs)IGListReloadDataUpdater" > IGListReloadDataUpdater< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Classes/IGListSectionController.html" > IGListSectionController< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Classes/IGListSingleSectionController.html" > IGListSingleSectionController< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Classes/IGListStackedSectionController.html" > IGListStackedSectionController< / a >
< / li >
< / ul >
< / li >
< li class = "nav-group-name" >
< a href = "../Constants.html" > Constants< / a >
< ul class = "nav-group-tasks" >
< li class = "nav-group-task" >
< a href = "../Constants.html#/c:@IGListKitVersionNumber" > IGListKitVersionNumber< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Constants.html#/c:@IGListKitVersionString" > IGListKitVersionString< / a >
< / li >
< / ul >
< / li >
< li class = "nav-group-name" >
2018-02-06 23:42:25 +00:00
< a href = "../Enums.html" > Enumerations< / a >
2016-09-07 22:37:59 +00:00
< ul class = "nav-group-tasks" >
2018-02-06 23:42:25 +00:00
< li class = "nav-group-task" >
< a href = "../Enums/IGListAdapterUpdateType.html" > IGListAdapterUpdateType< / a >
< / li >
2016-09-07 22:37:59 +00:00
< li class = "nav-group-task" >
< a href = "../Enums/IGListDiffOption.html" > IGListDiffOption< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Enums/IGListExperiment.html" > IGListExperiment< / a >
< / li >
< / ul >
< / li >
< li class = "nav-group-name" >
< a href = "../Protocols.html" > Protocols< / a >
< ul class = "nav-group-tasks" >
< li class = "nav-group-task" >
< a href = "../Protocols/IGListAdapterDataSource.html" > IGListAdapterDataSource< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Protocols/IGListAdapterDelegate.html" > IGListAdapterDelegate< / a >
< / li >
2018-04-23 16:27:43 +00:00
< li class = "nav-group-task" >
< a href = "../Protocols/IGListAdapterMoveDelegate.html" > IGListAdapterMoveDelegate< / a >
< / li >
2018-02-06 23:42:25 +00:00
< li class = "nav-group-task" >
< a href = "../Protocols/IGListAdapterUpdateListener.html" > IGListAdapterUpdateListener< / a >
< / li >
2016-09-07 22:37:59 +00:00
< li class = "nav-group-task" >
< a href = "../Protocols/IGListAdapterUpdaterDelegate.html" > IGListAdapterUpdaterDelegate< / a >
< / li >
2017-05-12 14:19:12 +00:00
< li class = "nav-group-task" >
< a href = "../Protocols/IGListBatchContext.html" > IGListBatchContext< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Protocols/IGListBindable.html" > IGListBindable< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Protocols/IGListBindingSectionControllerDataSource.html" > IGListBindingSectionControllerDataSource< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Protocols/IGListBindingSectionControllerSelectionDelegate.html" > IGListBindingSectionControllerSelectionDelegate< / a >
< / li >
2016-09-07 22:37:59 +00:00
< li class = "nav-group-task" >
< a href = "../Protocols/IGListCollectionContext.html" > IGListCollectionContext< / a >
< / li >
2018-02-06 23:42:25 +00:00
< li class = "nav-group-task" >
< a href = "../Protocols/IGListCollectionViewDelegateLayout.html" > IGListCollectionViewDelegateLayout< / a >
< / li >
2016-09-07 22:37:59 +00:00
< li class = "nav-group-task" >
< a href = "../Protocols/IGListDiffable.html" > IGListDiffable< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Protocols/IGListDisplayDelegate.html" > IGListDisplayDelegate< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Protocols/IGListScrollDelegate.html" > IGListScrollDelegate< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Protocols/IGListSingleSectionControllerDelegate.html" > IGListSingleSectionControllerDelegate< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Protocols/IGListSupplementaryViewSource.html" > IGListSupplementaryViewSource< / a >
< / li >
2018-02-06 23:42:25 +00:00
< li class = "nav-group-task" >
< a href = "../Protocols/IGListTransitionDelegate.html" > IGListTransitionDelegate< / a >
< / li >
2016-09-07 22:37:59 +00:00
< li class = "nav-group-task" >
< a href = "../Protocols/IGListUpdatingDelegate.html" > IGListUpdatingDelegate< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Protocols/IGListWorkingRangeDelegate.html" > IGListWorkingRangeDelegate< / a >
< / li >
< / ul >
< / li >
< li class = "nav-group-name" >
< a href = "../Type Definitions.html" > Type Definitions< / a >
< ul class = "nav-group-tasks" >
< li class = "nav-group-task" >
< a href = "../Type Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListItemUpdateBlock" > IGListItemUpdateBlock< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Type Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListObjectTransitionBlock" > IGListObjectTransitionBlock< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Type Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListReloadUpdateBlock" > IGListReloadUpdateBlock< / a >
< / li >
2016-11-21 23:36:26 +00:00
< li class = "nav-group-task" >
< a href = "../Type Definitions.html#/c:IGListSingleSectionController.h@T@IGListSingleSectionCellConfigureBlock" > IGListSingleSectionCellConfigureBlock< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Type Definitions.html#/c:IGListSingleSectionController.h@T@IGListSingleSectionCellSizeBlock" > IGListSingleSectionCellSizeBlock< / a >
< / li >
2018-05-01 23:54:35 +00:00
< li class = "nav-group-task" >
< a href = "../Type Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListToObjectBlock" > IGListToObjectBlock< / a >
< / li >
2016-09-07 22:37:59 +00:00
< li class = "nav-group-task" >
< a href = "../Type Definitions.html#/c:IGListAdapter.h@T@IGListUpdaterCompletion" > IGListUpdaterCompletion< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Type Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListUpdatingCompletion" > IGListUpdatingCompletion< / a >
< / li >
< / ul >
< / li >
< li class = "nav-group-name" >
< a href = "../Functions.html" > Functions< / a >
< ul class = "nav-group-tasks" >
< li class = "nav-group-task" >
< a href = "../Functions.html#/c:@F@IGListDiff" > IGListDiff< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Functions.html#/c:@F@IGListDiffExperiment" > IGListDiffExperiment< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Functions.html#/c:@F@IGListDiffPaths" > IGListDiffPaths< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Functions.html#/c:@F@IGListDiffPathsExperiment" > IGListDiffPathsExperiment< / a >
< / li >
< li class = "nav-group-task" >
< a href = "../Functions.html#/c:IGListExperiments.h@F@IGListExperimentEnabled" > IGListExperimentEnabled< / a >
< / li >
< / ul >
< / li >
< / ul >
< / nav >
< article class = "main-content" >
< section >
< section class = "section" >
< h1 > IGListSingleSectionController< / h1 >
< div class = "declaration" >
< div class = "language" >
2018-02-06 23:42:25 +00:00
< pre class = "highlight objective_c" > < code >
2017-05-12 14:19:12 +00:00
< span class = "k" > @interface< / span > < span class = "nc" > IGListSingleSectionController< / span > < span class = "p" > :< / span > < span class = "nc" > < a href = "../Classes/IGListSectionController.html" > IGListSectionController< / a > < / span > < / code > < / pre >
2016-09-07 22:37:59 +00:00
< / div >
< / div >
2016-11-21 23:36:26 +00:00
< p > This section controller is meant to make building simple, single-cell lists easier. By providing the type of cell, a block
2017-05-12 14:19:12 +00:00
to configure the cell, and a block to return the size of a cell, you can use an < code > < a href = "../Classes/IGListAdapter.html" > IGListAdapter< / a > < / code > -powered list with a
simpler architecture.< / p >
2016-09-07 22:37:59 +00:00
< / section >
< section class = "section task-group-section" >
< div class = "task-group" >
< ul >
< li class = "item" >
< div >
< code >
< a name = "/c:objc(cs)IGListSingleSectionController(im)initWithCellClass:configureBlock:sizeBlock:" > < / a >
< a name = "//apple_ref/objc/Method/-initWithCellClass:configureBlock:sizeBlock:" class = "dashAnchor" > < / a >
< a class = "token" href = "#/c:objc(cs)IGListSingleSectionController(im)initWithCellClass:configureBlock:sizeBlock:" > -initWithCellClass:configureBlock:sizeBlock:< / a >
< / code >
< / div >
< div class = "height-container" >
< div class = "pointer-container" > < / div >
< section class = "section" >
< div class = "pointer" > < / div >
< div class = "abstract" >
2016-11-21 23:36:26 +00:00
< p > Creates a new section controller for a given cell type that will always have only one cell when present in a list.< / p >
2016-09-07 22:37:59 +00:00
< div class = "aside aside-warning" >
< p class = "aside-title" > Warning< / p >
< p > Be VERY CAREFUL not to create retain cycles by holding strong references to: the object that owns the adapter
2016-11-21 23:36:26 +00:00
(usually < code > self< / code > ) or the < code > < a href = "../Classes/IGListAdapter.html" > IGListAdapter< / a > < / code > . Pass in locally scoped objects or use < code > weak< / code > references!< / p >
2016-09-07 22:37:59 +00:00
< / div >
< / div >
< div class = "declaration" >
< h4 > Declaration< / h4 >
< div class = "language" >
< p class = "aside-title" > Objective-C< / p >
2018-02-06 23:42:25 +00:00
< pre class = "highlight objective_c" > < code > < span class = "k" > -< / span > < span class = "p" > (< / span > < span class = "n" > nonnull< / span > < span class = "n" > instancetype< / span > < span class = "p" > )< / span >
2016-09-07 22:37:59 +00:00
< span class = "nf" > initWithCellClass< / span > < span class = "p" > :(< / span > < span class = "n" > nonnull< / span > < span class = "n" > Class< / span > < span class = "p" > )< / span > < span class = "nv" > cellClass< / span >
2016-11-21 23:36:26 +00:00
< span class = "nf" > configureBlock< / span > < span class = "p" > :(< / span > < span class = "n" > nonnull< / span > < span class = "n" > < a href = "../Type Definitions.html#/c:IGListSingleSectionController.h@T@IGListSingleSectionCellConfigureBlock" > IGListSingleSectionCellConfigureBlock< / a > < / span > < span class = "p" > )< / span > < span class = "nv" > configureBlock< / span >
< span class = "nf" > sizeBlock< / span > < span class = "p" > :(< / span > < span class = "n" > nonnull< / span > < span class = "n" > < a href = "../Type Definitions.html#/c:IGListSingleSectionController.h@T@IGListSingleSectionCellSizeBlock" > IGListSingleSectionCellSizeBlock< / a > < / span > < span class = "p" > )< / span > < span class = "nv" > sizeBlock< / span > < span class = "p" > ;< / span > < / code > < / pre >
2016-09-07 22:37:59 +00:00
< / div >
2017-08-23 21:12:05 +00:00
< div class = "language" >
< p class = "aside-title" > Swift< / p >
2018-02-06 23:42:25 +00:00
< pre class = "highlight swift" > < code > < span class = "nf" > init< / span > < span class = "p" > (< / span > < span class = "nv" > cellClass< / span > < span class = "p" > :< / span > < span class = "kt" > AnyClass< / span > < span class = "p" > ,< / span > < span class = "nv" > configureBlock< / span > < span class = "p" > :< / span > < span class = "kd" > @escaping< / span > < span class = "kt" > ListSingleSectionCellConfigureBlock< / span > < span class = "p" > ,< / span > < span class = "nv" > sizeBlock< / span > < span class = "p" > :< / span > < span class = "kd" > @escaping< / span > < span class = "kt" > ListSingleSectionCellSizeBlock< / span > < span class = "p" > )< / span > < / code > < / pre >
2017-08-23 21:12:05 +00:00
< / div >
2016-09-07 22:37:59 +00:00
< / div >
< div >
< h4 > Parameters< / h4 >
< table class = "graybox" >
< tbody >
< tr >
< td >
< code >
< em > cellClass< / em >
< / code >
< / td >
< td >
< div >
2016-11-21 23:36:26 +00:00
< p > The < code > UICollectionViewCell< / code > subclass for the single cell.< / p >
2016-09-07 22:37:59 +00:00
< / div >
< / td >
< / tr >
< tr >
< td >
< code >
< em > configureBlock< / em >
< / code >
< / td >
< td >
< div >
< p > A block that configures the cell with the item given to the section controller.< / p >
< / div >
< / td >
< / tr >
< tr >
< td >
< code >
< em > sizeBlock< / em >
< / code >
< / td >
< td >
< div >
< p > A block that returns the size for the cell given the collection context.< / p >
< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
< div >
< h4 > Return Value< / h4 >
< p > A new section controller.< / p >
< / div >
< / section >
< / div >
< / li >
< li class = "item" >
< div >
< code >
2016-11-21 23:36:26 +00:00
< a name = "/c:objc(cs)IGListSingleSectionController(im)initWithNibName:bundle:configureBlock:sizeBlock:" > < / a >
< a name = "//apple_ref/objc/Method/-initWithNibName:bundle:configureBlock:sizeBlock:" class = "dashAnchor" > < / a >
< a class = "token" href = "#/c:objc(cs)IGListSingleSectionController(im)initWithNibName:bundle:configureBlock:sizeBlock:" > -initWithNibName:bundle:configureBlock:sizeBlock:< / a >
2016-09-07 22:37:59 +00:00
< / code >
< / div >
< div class = "height-container" >
< div class = "pointer-container" > < / div >
< section class = "section" >
< div class = "pointer" > < / div >
< div class = "abstract" >
2016-11-21 23:36:26 +00:00
< p > Creates a new section controller for a given nib name and bundle that will always have only one cell when present in a list.< / p >
< div class = "aside aside-warning" >
< p class = "aside-title" > Warning< / p >
< p > Be VERY CAREFUL not to create retain cycles by holding strong references to: the object that owns the adapter
(usually < code > self< / code > ) or the < code > < a href = "../Classes/IGListAdapter.html" > IGListAdapter< / a > < / code > . Pass in locally scoped objects or use < code > weak< / code > references!< / p >
< / div >
2016-09-07 22:37:59 +00:00
< / div >
< div class = "declaration" >
< h4 > Declaration< / h4 >
< div class = "language" >
< p class = "aside-title" > Objective-C< / p >
2018-02-06 23:42:25 +00:00
< pre class = "highlight objective_c" > < code > < span class = "k" > -< / span > < span class = "p" > (< / span > < span class = "n" > nonnull< / span > < span class = "n" > instancetype< / span > < span class = "p" > )< / span >
2016-11-21 23:36:26 +00:00
< span class = "nf" > initWithNibName< / span > < span class = "p" > :(< / span > < span class = "n" > nonnull< / span > < span class = "n" > NSString< / span > < span class = "o" > *< / span > < span class = "p" > )< / span > < span class = "nv" > nibName< / span >
< span class = "nf" > bundle< / span > < span class = "p" > :(< / span > < span class = "n" > nullable< / span > < span class = "n" > NSBundle< / span > < span class = "o" > *< / span > < span class = "p" > )< / span > < span class = "nv" > bundle< / span >
< span class = "nf" > configureBlock< / span > < span class = "p" > :(< / span > < span class = "n" > nonnull< / span > < span class = "n" > < a href = "../Type Definitions.html#/c:IGListSingleSectionController.h@T@IGListSingleSectionCellConfigureBlock" > IGListSingleSectionCellConfigureBlock< / a > < / span > < span class = "p" > )< / span > < span class = "nv" > configureBlock< / span >
< span class = "nf" > sizeBlock< / span > < span class = "p" > :(< / span > < span class = "n" > nonnull< / span > < span class = "n" > < a href = "../Type Definitions.html#/c:IGListSingleSectionController.h@T@IGListSingleSectionCellSizeBlock" > IGListSingleSectionCellSizeBlock< / a > < / span > < span class = "p" > )< / span > < span class = "nv" > sizeBlock< / span > < span class = "p" > ;< / span > < / code > < / pre >
2016-09-07 22:37:59 +00:00
< / div >
2017-08-23 21:12:05 +00:00
< div class = "language" >
< p class = "aside-title" > Swift< / p >
2018-02-06 23:42:25 +00:00
< pre class = "highlight swift" > < code > < span class = "nf" > init< / span > < span class = "p" > (< / span > < span class = "nv" > nibName< / span > < span class = "p" > :< / span > < span class = "kt" > String< / span > < span class = "p" > ,< / span > < span class = "nv" > bundle< / span > < span class = "p" > :< / span > < span class = "kt" > Bundle< / span > < span class = "p" > ?,< / span > < span class = "nv" > configureBlock< / span > < span class = "p" > :< / span > < span class = "kd" > @escaping< / span > < span class = "kt" > ListSingleSectionCellConfigureBlock< / span > < span class = "p" > ,< / span > < span class = "nv" > sizeBlock< / span > < span class = "p" > :< / span > < span class = "kd" > @escaping< / span > < span class = "kt" > ListSingleSectionCellSizeBlock< / span > < span class = "p" > )< / span > < / code > < / pre >
2017-08-23 21:12:05 +00:00
< / div >
2016-09-07 22:37:59 +00:00
< / div >
2016-11-21 23:36:26 +00:00
< div >
< h4 > Parameters< / h4 >
< table class = "graybox" >
< tbody >
< tr >
< td >
< code >
< em > nibName< / em >
< / code >
< / td >
< td >
< div >
< p > The name of the nib file for the single cell.< / p >
< / div >
< / td >
< / tr >
< tr >
< td >
< code >
< em > bundle< / em >
< / code >
< / td >
< td >
< div >
2017-05-12 14:19:12 +00:00
< p > The bundle in which to search for the nib file. If < code > nil< / code > , this method looks for the file in the main bundle.< / p >
2016-11-21 23:36:26 +00:00
< / div >
< / td >
< / tr >
< tr >
< td >
< code >
< em > configureBlock< / em >
< / code >
< / td >
< td >
< div >
< p > A block that configures the cell with the item given to the section controller.< / p >
< / div >
< / td >
< / tr >
< tr >
< td >
< code >
< em > sizeBlock< / em >
< / code >
< / td >
< td >
< div >
< p > A block that returns the size for the cell given the collection context.< / p >
< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
< div >
< h4 > Return Value< / h4 >
< p > A new section controller.< / p >
< / div >
2016-09-07 22:37:59 +00:00
< / section >
< / div >
< / li >
< li class = "item" >
< div >
< code >
2016-11-21 23:36:26 +00:00
< a name = "/c:objc(cs)IGListSingleSectionController(im)initWithStoryboardCellIdentifier:configureBlock:sizeBlock:" > < / a >
< a name = "//apple_ref/objc/Method/-initWithStoryboardCellIdentifier:configureBlock:sizeBlock:" class = "dashAnchor" > < / a >
< a class = "token" href = "#/c:objc(cs)IGListSingleSectionController(im)initWithStoryboardCellIdentifier:configureBlock:sizeBlock:" > -initWithStoryboardCellIdentifier:configureBlock:sizeBlock:< / a >
2016-09-07 22:37:59 +00:00
< / code >
< / div >
< div class = "height-container" >
< div class = "pointer-container" > < / div >
< section class = "section" >
< div class = "pointer" > < / div >
< div class = "abstract" >
2016-11-21 23:36:26 +00:00
< p > Creates a new section controller for a given storyboard cell identifier that will always have only one cell when present in a list.< / p >
< div class = "aside aside-warning" >
< p class = "aside-title" > Warning< / p >
< p > Be VERY CAREFUL not to create retain cycles by holding strong references to: the object that owns the adapter
(usually < code > self< / code > ) or the < code > < a href = "../Classes/IGListAdapter.html" > IGListAdapter< / a > < / code > . Pass in locally scoped objects or use < code > weak< / code > references!< / p >
< / div >
2016-09-07 22:37:59 +00:00
< / div >
< div class = "declaration" >
< h4 > Declaration< / h4 >
< div class = "language" >
< p class = "aside-title" > Objective-C< / p >
2018-02-06 23:42:25 +00:00
< pre class = "highlight objective_c" > < code > < span class = "k" > -< / span > < span class = "p" > (< / span > < span class = "n" > nonnull< / span > < span class = "n" > instancetype< / span > < span class = "p" > )< / span >
2016-11-21 23:36:26 +00:00
< span class = "nf" > initWithStoryboardCellIdentifier< / span > < span class = "p" > :(< / span > < span class = "n" > nonnull< / span > < span class = "n" > NSString< / span > < span class = "o" > *< / span > < span class = "p" > )< / span > < span class = "nv" > identifier< / span >
< span class = "nf" > configureBlock< / span > < span class = "p" > :(< / span > < span class = "n" > nonnull< / span > < span class = "n" > < a href = "../Type Definitions.html#/c:IGListSingleSectionController.h@T@IGListSingleSectionCellConfigureBlock" > IGListSingleSectionCellConfigureBlock< / a > < / span > < span class = "p" > )< / span >
< span class = "n" > configureBlock< / span >
< span class = "n" > sizeBlock< / span > < span class = "o" > :< / span >
< span class = "p" > (< / span > < span class = "n" > nonnull< / span > < span class = "n" > < a href = "../Type Definitions.html#/c:IGListSingleSectionController.h@T@IGListSingleSectionCellSizeBlock" > IGListSingleSectionCellSizeBlock< / a > < / span > < span class = "p" > )< / span > < span class = "n" > sizeBlock< / span > < span class = "p" > ;< / span > < / code > < / pre >
2016-09-07 22:37:59 +00:00
< / div >
2017-08-23 21:12:05 +00:00
< div class = "language" >
< p class = "aside-title" > Swift< / p >
2018-02-06 23:42:25 +00:00
< pre class = "highlight swift" > < code > < span class = "nf" > init< / span > < span class = "p" > (< / span > < span class = "n" > storyboardCellIdentifier< / span > < span class = "nv" > identifier< / span > < span class = "p" > :< / span > < span class = "kt" > String< / span > < span class = "p" > ,< / span > < span class = "nv" > configureBlock< / span > < span class = "p" > :< / span > < span class = "kd" > @escaping< / span > < span class = "kt" > ListSingleSectionCellConfigureBlock< / span > < span class = "p" > ,< / span > < span class = "nv" > sizeBlock< / span > < span class = "p" > :< / span > < span class = "kd" > @escaping< / span > < span class = "kt" > ListSingleSectionCellSizeBlock< / span > < span class = "p" > )< / span > < / code > < / pre >
2017-08-23 21:12:05 +00:00
< / div >
2016-11-21 23:36:26 +00:00
< / div >
< div >
< h4 > Parameters< / h4 >
< table class = "graybox" >
< tbody >
< tr >
< td >
< code >
< em > identifier< / em >
< / code >
< / td >
< td >
< div >
< p > The identifier of the cell prototype in storyboard.< / p >
< / div >
< / td >
< / tr >
< tr >
< td >
< code >
< em > configureBlock< / em >
< / code >
< / td >
< td >
< div >
< p > A block that configures the cell with the item given to the section controller.< / p >
< / div >
< / td >
< / tr >
< tr >
< td >
< code >
< em > sizeBlock< / em >
< / code >
< / td >
< td >
< div >
< p > A block that returns the size for the cell given the collection context.< / p >
< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
< div >
< h4 > Return Value< / h4 >
< p > A new section controller.< / p >
2016-09-07 22:37:59 +00:00
< / div >
< / section >
< / div >
< / li >
< li class = "item" >
< div >
< code >
2016-11-21 23:36:26 +00:00
< a name = "/c:objc(cs)IGListSingleSectionController(py)selectionDelegate" > < / a >
< a name = "//apple_ref/objc/Property/selectionDelegate" class = "dashAnchor" > < / a >
< a class = "token" href = "#/c:objc(cs)IGListSingleSectionController(py)selectionDelegate" > selectionDelegate< / a >
2016-09-07 22:37:59 +00:00
< / code >
< / div >
< div class = "height-container" >
< div class = "pointer-container" > < / div >
< section class = "section" >
< div class = "pointer" > < / div >
< div class = "abstract" >
2016-11-21 23:36:26 +00:00
< p > An optional delegate that handles selection and deselection.< / p >
2016-09-07 22:37:59 +00:00
< / div >
< div class = "declaration" >
< h4 > Declaration< / h4 >
< div class = "language" >
< p class = "aside-title" > Objective-C< / p >
2018-02-06 23:42:25 +00:00
< pre class = "highlight objective_c" > < code > < span class = "k" > @property< / span > < span class = "p" > (< / span > < span class = "n" > readwrite< / span > < span class = "p" > ,< / span > < span class = "n" > nonatomic< / span > < span class = "p" > ,< / span > < span class = "n" > nullable< / span > < span class = "p" > )< / span >
2016-11-21 23:36:26 +00:00
< span class = "n" > id< / span > < span class = "o" > < < / span > < span class = "n" > < a href = "../Protocols/IGListSingleSectionControllerDelegate.html" > IGListSingleSectionControllerDelegate< / a > < / span > < span class = "o" > > < / span >
< span class = "n" > selectionDelegate< / span > < span class = "p" > ;< / span > < / code > < / pre >
< / div >
2017-08-23 21:12:05 +00:00
< div class = "language" >
< p class = "aside-title" > Swift< / p >
2018-02-06 23:42:25 +00:00
< pre class = "highlight swift" > < code > < span class = "k" > weak< / span > < span class = "k" > var< / span > < span class = "nv" > selectionDelegate< / span > < span class = "p" > :< / span > < span class = "kt" > ListSingleSectionControllerDelegate< / span > < span class = "p" > ?< / span > < span class = "p" > {< / span > < span class = "k" > get< / span > < span class = "k" > set< / span > < span class = "p" > }< / span > < / code > < / pre >
2017-08-23 21:12:05 +00:00
< / div >
2016-09-07 22:37:59 +00:00
< / div >
< / section >
< / div >
< / li >
< / ul >
< / div >
< / section >
< / section >
< section id = "footer" >
2018-05-01 23:54:35 +00:00
< p > © 2018 < a class = "link" href = "https://twitter.com/fbOpenSource" target = "_blank" rel = "external" > Instagram< / a > . All rights reserved. (Last updated: 2018-05-01)< / p >
2018-02-06 23:42:25 +00:00
< p > Generated by < a class = "link" href = "https://github.com/realm/jazzy" target = "_blank" rel = "external" > jazzy ♪♫ v0.9.1< / a > , a < a class = "link" href = "http://realm.io" target = "_blank" rel = "external" > Realm< / a > project.< / p >
2016-09-07 22:37:59 +00:00
< / section >
< / article >
< / div >
< / body >
< / div >
< / html >