ViewRegistration

public struct ViewRegistration : Hashable, Sendable

Describes all information needed to register a view for reuse with a UICollectionView.

  • The view reuse identifier.

    Declaration

    Swift

    public let reuseIdentifier: String
  • The type of view to register.

    Declaration

    Swift

    public let viewType: ViewRegistrationViewType
  • The view registration method.

    Declaration

    Swift

    public let method: ViewRegistrationMethod
  • Initializes a ViewRegistration.

    Declaration

    Swift

    public init(
        reuseIdentifier: String,
        viewType: ViewRegistrationViewType,
        method: ViewRegistrationMethod
    )

    Parameters

    reuseIdentifier

    The view reuse identifier.

    viewType

    The type of view to register.

    method

    The view registration method.

  • Convenience initializer for a class-based cell.

    Declaration

    Swift

    public init(reuseIdentifier: String, cellClass: AnyClass)

    Parameters

    reuseIdentifier

    The cell reuse identifier.

    cellClass

    The cell class.

  • Convenience initializer for a nib-based cell in the main bundle.

    Declaration

    Swift

    public init(reuseIdentifier: String, cellNibName: String)

    Parameters

    reuseIdentifier

    The cell reuse identifier.

    cellNibName

    The nib name for the cell.

  • Convenience initializer for a class-based supplementary view.

    Declaration

    Swift

    public init(reuseIdentifier: String, supplementaryViewClass: AnyClass, kind: String)

    Parameters

    reuseIdentifier

    The view reuse identifier.

    supplementaryViewClass

    The view class.

    kind

    The supplementary view kind.

  • Convenience initializer for a nib-based supplementary view in the main bundle.

    Declaration

    Swift

    public init(reuseIdentifier: String, supplementaryViewNibName: String, kind: String)

    Parameters

    reuseIdentifier

    The view reuse identifier.

    supplementaryViewNibName

    The nib name for the view.

    kind

    The supplementary view kind.