One Logo Pool Ball
UIKit · IOS API REFERENCE

UICollectionView

class · iOS 6.0+ · SDK 27.1

@MainActor class UICollectionView

Members (93)

get · iOS 6.0+

elementKindSectionFooter

TypeScript
static get elementKindSectionFooter(): Promise<string>
Swift declaration
class let elementKindSectionFooter: String
get · iOS 6.0+

elementKindSectionHeader

TypeScript
static get elementKindSectionHeader(): Promise<string>
Swift declaration
class let elementKindSectionHeader: String
method · iOS 9.0+

beginInteractiveMovementForItem

TypeScript
beginInteractiveMovementForItem(indexPath: _Foundation_IndexPath): Promise<boolean>
Swift declaration
func beginInteractiveMovementForItem(at indexPath: IndexPath) -> Bool
method · iOS 9.0+

cancelInteractiveMovement

TypeScript
cancelInteractiveMovement(): Promise<void>
Swift declaration
func cancelInteractiveMovement()
method · iOS 7.0+

cancelInteractiveTransition

TypeScript
cancelInteractiveTransition(): Promise<void>
Swift declaration
func cancelInteractiveTransition()
method · iOS 6.0+

cellForItem

TypeScript
cellForItem(indexPath: _Foundation_IndexPath): Promise<(UICollectionViewCell) | null>
Swift declaration
func cellForItem(at indexPath: IndexPath) -> UICollectionViewCell?
method · iOS 6.0+

deleteItems

TypeScript
deleteItems(indexPaths: Array<_Foundation_IndexPath>): Promise<void>
Swift declaration
func deleteItems(at indexPaths: [IndexPath])
method · iOS 6.0+

deleteSections

TypeScript
deleteSections(sections: _Foundation_IndexSet): Promise<void>
Swift declaration
func deleteSections(_ sections: IndexSet)
method · iOS 6.0+

dequeueReusableCell

TypeScript
dequeueReusableCell(identifier: string, indexPath: _Foundation_IndexPath): Promise<UICollectionViewCell>
Swift declaration
func dequeueReusableCell(withReuseIdentifier identifier: String, for indexPath: IndexPath) -> UICollectionViewCell
method · iOS 6.0+

dequeueReusableSupplementaryView

TypeScript
dequeueReusableSupplementaryView(elementKind: string, identifier: string, indexPath: _Foundation_IndexPath): Promise<UICollectionReusableView>
Swift declaration
func dequeueReusableSupplementaryView(ofKind elementKind: String, withReuseIdentifier identifier: String, for indexPath: IndexPath) -> UICollectionReusableView
method · iOS 6.0+

deselectItem

TypeScript
deselectItem(indexPath: _Foundation_IndexPath, animated: boolean): Promise<void>
Swift declaration
func deselectItem(at indexPath: IndexPath, animated: Bool)
method · iOS 9.0+

endInteractiveMovement

TypeScript
endInteractiveMovement(): Promise<void>
Swift declaration
func endInteractiveMovement()
method · iOS 7.0+

finishInteractiveTransition

TypeScript
finishInteractiveTransition(): Promise<void>
Swift declaration
func finishInteractiveTransition()
method · iOS 6.0+

indexPath

TypeScript
indexPathFor(cell: UICollectionViewCell): Promise<(_Foundation_IndexPath) | null>
Swift declaration
func indexPath(for cell: UICollectionViewCell) -> IndexPath?
method · iOS 6.0+

indexPathForItem

TypeScript
indexPathForItem(point: { x: number; y: number }): Promise<(_Foundation_IndexPath) | null>
Swift declaration
func indexPathForItem(at point: CGPoint) -> IndexPath?
method · iOS 6.0+

indexPath

TypeScript
indexPathForSupplementaryView(supplementaryView: UICollectionReusableView): Promise<(_Foundation_IndexPath) | null>
Swift declaration
func indexPath(forSupplementaryView supplementaryView: UICollectionReusableView) -> IndexPath?
method · iOS 9.0+

indexPathsForVisibleSupplementaryElements

TypeScript
indexPathsForVisibleSupplementaryElements(elementKind: string): Promise<Array<_Foundation_IndexPath>>
Swift declaration
func indexPathsForVisibleSupplementaryElements(ofKind elementKind: String) -> [IndexPath]
init · iOS 6.0+

init

TypeScript
static initCoder(coder: _Foundation_NSCoder): Promise<(UICollectionView) | null>
Swift declaration
init?(coder: NSCoder)
init · iOS 6.0+

init

TypeScript
static initFrameCollectionViewLayout(frame: { x: number; y: number; width: number; height: number }, layout: UICollectionViewLayout): Promise<UICollectionView>
Swift declaration
init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout)
method · iOS 6.0+

insertItems

TypeScript
insertItems(indexPaths: Array<_Foundation_IndexPath>): Promise<void>
Swift declaration
func insertItems(at indexPaths: [IndexPath])
method · iOS 6.0+

insertSections

TypeScript
insertSections(sections: _Foundation_IndexSet): Promise<void>
Swift declaration
func insertSections(_ sections: IndexSet)
method · iOS 6.0+

layoutAttributesForItem

TypeScript
layoutAttributesForItem(indexPath: _Foundation_IndexPath): Promise<(UICollectionViewLayoutAttributes) | null>
Swift declaration
func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes?
method · iOS 6.0+

layoutAttributesForSupplementaryElement

TypeScript
layoutAttributesForSupplementaryElement(kind: string, indexPath: _Foundation_IndexPath): Promise<(UICollectionViewLayoutAttributes) | null>
Swift declaration
func layoutAttributesForSupplementaryElement(ofKind kind: String, at indexPath: IndexPath) -> UICollectionViewLayoutAttributes?
method · iOS 6.0+

moveItem

TypeScript
moveItem(indexPath: _Foundation_IndexPath, newIndexPath: _Foundation_IndexPath): Promise<void>
Swift declaration
func moveItem(at indexPath: IndexPath, to newIndexPath: IndexPath)
method · iOS 6.0+

moveSection

TypeScript
moveSection(section: number, newSection: number): Promise<void>
Swift declaration
func moveSection(_ section: Int, toSection newSection: Int)
method · iOS 6.0+

numberOfItems

TypeScript
numberOfItems(section: number): Promise<number>
Swift declaration
func numberOfItems(inSection section: Int) -> Int
method · iOS 6.0+

performBatchUpdates

TypeScript
performBatchUpdates(updates?: ((() => void)) | null, completion?: (((arg0: boolean) => void)) | null): Promise<void>
Swift declaration
func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)? = nil)
method · iOS 15.0+

reconfigureItems

TypeScript
reconfigureItems(indexPaths: Array<_Foundation_IndexPath>): Promise<void>
Swift declaration
func reconfigureItems(at indexPaths: [IndexPath])
method · iOS 6.0+

register

TypeScript
registerForCellWithReuseIdentifier(cellClass: (string) | null, identifier: string): Promise<void>
Swift declaration
func register(_ cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String)
method · iOS 6.0+

register

TypeScript
registerForSupplementaryViewOfKindWithReuseIdentifier(viewClass: (string) | null, elementKind: string, identifier: string): Promise<void>
Swift declaration
func register(_ viewClass: AnyClass?, forSupplementaryViewOfKind elementKind: String, withReuseIdentifier identifier: String)
method · iOS 6.0+

register

TypeScript
registerForCellWithReuseIdentifier94379(nib: (UINib) | null, identifier: string): Promise<void>
Swift declaration
func register(_ nib: UINib?, forCellWithReuseIdentifier identifier: String)
method · iOS 6.0+

register

TypeScript
registerForSupplementaryViewOfKindWithReuseIdentifier53850(nib: (UINib) | null, kind: string, identifier: string): Promise<void>
Swift declaration
func register(_ nib: UINib?, forSupplementaryViewOfKind kind: String, withReuseIdentifier identifier: String)
method · iOS 6.0+

reloadData

TypeScript
reloadData(): Promise<void>
Swift declaration
func reloadData()
method · iOS 6.0+

reloadItems

TypeScript
reloadItems(indexPaths: Array<_Foundation_IndexPath>): Promise<void>
Swift declaration
func reloadItems(at indexPaths: [IndexPath])
method · iOS 6.0+

reloadSections

TypeScript
reloadSections(sections: _Foundation_IndexSet): Promise<void>
Swift declaration
func reloadSections(_ sections: IndexSet)
method · iOS 6.0+

scrollToItem

TypeScript
scrollToItem(indexPath: _Foundation_IndexPath, scrollPosition: UICollectionView_ScrollPosition, animated: boolean): Promise<void>
Swift declaration
func scrollToItem(at indexPath: IndexPath, at scrollPosition: UICollectionView.ScrollPosition, animated: Bool)
method · iOS 6.0+

selectItem

TypeScript
selectItem(indexPath: (_Foundation_IndexPath) | null, animated: boolean, scrollPosition: UICollectionView_ScrollPosition): Promise<void>
Swift declaration
func selectItem(at indexPath: IndexPath?, animated: Bool, scrollPosition: UICollectionView.ScrollPosition)
method · iOS 6.0+

setCollectionViewLayout

TypeScript
setCollectionViewLayoutAnimated(layout: UICollectionViewLayout, animated: boolean): Promise<void>
Swift declaration
func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool)
method · iOS 7.0+

setCollectionViewLayout

TypeScript
setCollectionViewLayoutAnimatedCompletion(layout: UICollectionViewLayout, animated: boolean, completion?: (((arg0: boolean) => void)) | null): Promise<void>
Swift declaration
func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool, completion: ((Bool) -> Void)? = nil)
method · iOS 7.0+

startInteractiveTransition

TypeScript
startInteractiveTransition(layout: UICollectionViewLayout, completion?: (((arg0: boolean, arg1: boolean) => void)) | null): Promise<UICollectionViewTransitionLayout>
Swift declaration
func startInteractiveTransition(to layout: UICollectionViewLayout, completion: UICollectionView.LayoutInteractiveTransitionCompletion? = nil) -> UICollectionViewTransitionLayout
method · iOS 9.0+

supplementaryView

TypeScript
supplementaryView(elementKind: string, indexPath: _Foundation_IndexPath): Promise<(UICollectionReusableView) | null>
Swift declaration
func supplementaryView(forElementKind elementKind: String, at indexPath: IndexPath) -> UICollectionReusableView?
method · iOS 9.0+

updateInteractiveMovementTargetPosition

TypeScript
updateInteractiveMovementTargetPosition(targetPosition: { x: number; y: number }): Promise<void>
Swift declaration
func updateInteractiveMovementTargetPosition(_ targetPosition: CGPoint)
method · iOS 9.0+

visibleSupplementaryViews

TypeScript
visibleSupplementaryViews(elementKind: string): Promise<Array<UICollectionReusableView>>
Swift declaration
func visibleSupplementaryViews(ofKind elementKind: String) -> [UICollectionReusableView]
get · iOS 15.0+

allowsFocus

TypeScript
get allowsFocus(): Promise<boolean>
Swift declaration
var allowsFocus: Bool { get set }
set · iOS 15.0+

allowsFocus

TypeScript
setAllowsFocus(value: boolean): Promise<void>
Swift declaration
var allowsFocus: Bool { get set }
get · iOS 15.0+

allowsFocusDuringEditing

TypeScript
get allowsFocusDuringEditing(): Promise<boolean>
Swift declaration
var allowsFocusDuringEditing: Bool { get set }
set · iOS 15.0+

allowsFocusDuringEditing

TypeScript
setAllowsFocusDuringEditing(value: boolean): Promise<void>
Swift declaration
var allowsFocusDuringEditing: Bool { get set }
get · iOS 6.0+

allowsMultipleSelection

TypeScript
get allowsMultipleSelection(): Promise<boolean>
Swift declaration
var allowsMultipleSelection: Bool { get set }
set · iOS 6.0+

allowsMultipleSelection

TypeScript
setAllowsMultipleSelection(value: boolean): Promise<void>
Swift declaration
var allowsMultipleSelection: Bool { get set }
get · iOS 14.0+

allowsMultipleSelectionDuringEditing

TypeScript
get allowsMultipleSelectionDuringEditing(): Promise<boolean>
Swift declaration
var allowsMultipleSelectionDuringEditing: Bool { get set }
set · iOS 14.0+

allowsMultipleSelectionDuringEditing

TypeScript
setAllowsMultipleSelectionDuringEditing(value: boolean): Promise<void>
Swift declaration
var allowsMultipleSelectionDuringEditing: Bool { get set }
get · iOS 6.0+

allowsSelection

TypeScript
get allowsSelection(): Promise<boolean>
Swift declaration
var allowsSelection: Bool { get set }
set · iOS 6.0+

allowsSelection

TypeScript
setAllowsSelection(value: boolean): Promise<void>
Swift declaration
var allowsSelection: Bool { get set }
get · iOS 14.0+

allowsSelectionDuringEditing

TypeScript
get allowsSelectionDuringEditing(): Promise<boolean>
Swift declaration
var allowsSelectionDuringEditing: Bool { get set }
set · iOS 14.0+

allowsSelectionDuringEditing

TypeScript
setAllowsSelectionDuringEditing(value: boolean): Promise<void>
Swift declaration
var allowsSelectionDuringEditing: Bool { get set }
get · iOS 6.0+

backgroundView

TypeScript
get backgroundView(): Promise<(UIView) | null>
Swift declaration
var backgroundView: UIView? { get set }
set · iOS 6.0+

backgroundView

TypeScript
setBackgroundView(value?: (UIView) | null): Promise<void>
Swift declaration
var backgroundView: UIView? { get set }
get · iOS 6.0+

collectionViewLayout

TypeScript
get collectionViewLayout(): Promise<UICollectionViewLayout>
Swift declaration
var collectionViewLayout: UICollectionViewLayout { get set }
set · iOS 6.0+

collectionViewLayout

TypeScript
setCollectionViewLayout(value: UICollectionViewLayout): Promise<void>
Swift declaration
var collectionViewLayout: UICollectionViewLayout { get set }
get · iOS 13.2+

contextMenuInteraction

TypeScript
get contextMenuInteraction(): Promise<(UIContextMenuInteraction) | null>
Swift declaration
var contextMenuInteraction: UIContextMenuInteraction? { get }
get · iOS 6.0+

dataSource

TypeScript
get dataSource(): Promise<(SDKHandle) | null>
Swift declaration
weak var dataSource: (any UICollectionViewDataSource)? { get set }
set · iOS 6.0+

dataSource

TypeScript
setDataSource(value?: (SDKHandle) | null): Promise<void>
Swift declaration
weak var dataSource: (any UICollectionViewDataSource)? { get set }
get · iOS 6.0+

delegate

TypeScript
get delegate(): Promise<(SDKHandle) | null>
Swift declaration
weak var delegate: (any UICollectionViewDelegate)? { get set }
set · iOS 6.0+

delegate

TypeScript
setDelegate(value?: (Implements<UICollectionViewDelegate> | SDKHandle) | null): Promise<void>
Swift declaration
weak var delegate: (any UICollectionViewDelegate)? { get set }
get · iOS 11.0+

dragDelegate

TypeScript
get dragDelegate(): Promise<(SDKHandle) | null>
Swift declaration
weak var dragDelegate: (any UICollectionViewDragDelegate)? { get set }
set · iOS 11.0+

dragDelegate

TypeScript
setDragDelegate(value?: (SDKHandle) | null): Promise<void>
Swift declaration
weak var dragDelegate: (any UICollectionViewDragDelegate)? { get set }
get · iOS 11.0+

dragInteractionEnabled

TypeScript
get dragInteractionEnabled(): Promise<boolean>
Swift declaration
var dragInteractionEnabled: Bool { get set }
set · iOS 11.0+

dragInteractionEnabled

TypeScript
setDragInteractionEnabled(value: boolean): Promise<void>
Swift declaration
var dragInteractionEnabled: Bool { get set }
get · iOS 11.0+

dropDelegate

TypeScript
get dropDelegate(): Promise<(SDKHandle) | null>
Swift declaration
weak var dropDelegate: (any UICollectionViewDropDelegate)? { get set }
set · iOS 11.0+

dropDelegate

TypeScript
setDropDelegate(value?: (Implements<UICollectionViewDropDelegate> | SDKHandle) | null): Promise<void>
Swift declaration
weak var dropDelegate: (any UICollectionViewDropDelegate)? { get set }
get · iOS 14.0+

isEditing

TypeScript
get isEditing(): Promise<boolean>
Swift declaration
var isEditing: Bool { get set }
set · iOS 14.0+

isEditing

TypeScript
setIsEditing(value: boolean): Promise<void>
Swift declaration
var isEditing: Bool { get set }
get · iOS 11.0+

hasActiveDrag

TypeScript
get hasActiveDrag(): Promise<boolean>
Swift declaration
var hasActiveDrag: Bool { get }
get · iOS 11.0+

hasActiveDrop

TypeScript
get hasActiveDrop(): Promise<boolean>
Swift declaration
var hasActiveDrop: Bool { get }
get · iOS 11.0+

hasUncommittedUpdates

TypeScript
get hasUncommittedUpdates(): Promise<boolean>
Swift declaration
var hasUncommittedUpdates: Bool { get }
get · iOS 6.0+

indexPathsForSelectedItems

TypeScript
get indexPathsForSelectedItems(): Promise<(Array<_Foundation_IndexPath>) | null>
Swift declaration
var indexPathsForSelectedItems: [IndexPath]? { get }
get · iOS 6.0+

indexPathsForVisibleItems

TypeScript
get indexPathsForVisibleItems(): Promise<Array<_Foundation_IndexPath>>
Swift declaration
var indexPathsForVisibleItems: [IndexPath] { get }
get · iOS 6.0+

numberOfSections

TypeScript
get numberOfSections(): Promise<number>
Swift declaration
var numberOfSections: Int { get }
get · iOS 10.0+

prefetchDataSource

TypeScript
get prefetchDataSource(): Promise<(SDKHandle) | null>
Swift declaration
weak var prefetchDataSource: (any UICollectionViewDataSourcePrefetching)? { get set }
set · iOS 10.0+

prefetchDataSource

TypeScript
setPrefetchDataSource(value?: (Implements<UICollectionViewDataSourcePrefetching> | SDKHandle) | null): Promise<void>
Swift declaration
weak var prefetchDataSource: (any UICollectionViewDataSourcePrefetching)? { get set }
get · iOS 10.0+

isPrefetchingEnabled

TypeScript
get isPrefetchingEnabled(): Promise<boolean>
Swift declaration
var isPrefetchingEnabled: Bool { get set }
set · iOS 10.0+

isPrefetchingEnabled

TypeScript
setIsPrefetchingEnabled(value: boolean): Promise<void>
Swift declaration
var isPrefetchingEnabled: Bool { get set }
get · iOS 9.0+

remembersLastFocusedIndexPath

TypeScript
get remembersLastFocusedIndexPath(): Promise<boolean>
Swift declaration
var remembersLastFocusedIndexPath: Bool { get set }
set · iOS 9.0+

remembersLastFocusedIndexPath

TypeScript
setRemembersLastFocusedIndexPath(value: boolean): Promise<void>
Swift declaration
var remembersLastFocusedIndexPath: Bool { get set }
get · iOS 11.0+

reorderingCadence

TypeScript
get reorderingCadence(): Promise<UICollectionView_ReorderingCadence>
Swift declaration
var reorderingCadence: UICollectionView.ReorderingCadence { get set }
set · iOS 11.0+

reorderingCadence

TypeScript
setReorderingCadence(value: UICollectionView_ReorderingCadence): Promise<void>
Swift declaration
var reorderingCadence: UICollectionView.ReorderingCadence { get set }
get · iOS 14.0+

selectionFollowsFocus

TypeScript
get selectionFollowsFocus(): Promise<boolean>
Swift declaration
var selectionFollowsFocus: Bool { get set }
set · iOS 14.0+

selectionFollowsFocus

TypeScript
setSelectionFollowsFocus(value: boolean): Promise<void>
Swift declaration
var selectionFollowsFocus: Bool { get set }
get · iOS 16.0+

selfSizingInvalidation

TypeScript
get selfSizingInvalidation(): Promise<UICollectionView_SelfSizingInvalidation>
Swift declaration
var selfSizingInvalidation: UICollectionView.SelfSizingInvalidation { get set }
set · iOS 16.0+

selfSizingInvalidation

TypeScript
setSelfSizingInvalidation(value: UICollectionView_SelfSizingInvalidation): Promise<void>
Swift declaration
var selfSizingInvalidation: UICollectionView.SelfSizingInvalidation { get set }
get · iOS 6.0+

visibleCells

TypeScript
get visibleCells(): Promise<Array<UICollectionViewCell>>
Swift declaration
var visibleCells: [UICollectionViewCell] { get }
method · iOS 14.0+

dequeueConfiguredReusableCell

TypeScript
dequeueConfiguredReusableCell(registration: UICollectionView_CellRegistration<UICollectionViewCell, unknown>, indexPath: _Foundation_IndexPath, item?: (unknown) | null): Promise<UICollectionViewCell>
Swift declaration
@MainActor @preconcurrency func dequeueConfiguredReusableCell<Cell, Item>(using registration: UICollectionView.CellRegistration<Cell, Item>, for indexPath: IndexPath, item: Item?) -> Cell where Cell : UICollectionViewCell
method · iOS 14.0+

dequeueConfiguredReusableSupplementary

TypeScript
dequeueConfiguredReusableSupplementary(registration: UICollectionView_SupplementaryRegistration<UICollectionReusableView>, indexPath: _Foundation_IndexPath): Promise<UICollectionReusableView>
Swift declaration
@MainActor @preconcurrency func dequeueConfiguredReusableSupplementary<Supplementary>(using registration: UICollectionView.SupplementaryRegistration<Supplementary>, for indexPath: IndexPath) -> Supplementary where Supplementary : UICollectionReusableView

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

UICollectionView.init()

inherited init: cannot prove legal (class declares 1 custom initializer)

All UIKit types →